1

As I am trying to transfer my website from localhost to a test domain on our server, I need to adjust my htaccess, since it refers on the localhost to a different folder. I am transfering it to test.mydomain.com/jellyweb/ yet whenever I adjust the rewritebase to match it, the site gives me a 500 error.

    php_flag display_errors on

    Options +FollowSymLinks
    RewriteEngine On

#   RewriteCond %{HTTP_HOST} ^195\.238\.74\.8 
#   RewriteRule (.*) http://www.jellyfishwebdesign.nl/$1 [R=301,L]  
#   RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
#   RewriteRule .* – [F,L]

    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    RewriteBase /test/jellyweb/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([A-Za-z0-9-]+)$ index.php?p=$1 [L]
    RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$  index.php?p=$1&sp=$2 [L]
    RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$  index.php?p=$1&sp=$2&t=$3 [L]

The folder layout is public_html/test/jellyweb

I am not sure how get the rewritebase link correctly in this case, cause even when i just do RewriteBase /jellyweb/ it doesn't work. Am I overseeing something? Sorry, htaccess is not I am familair with really.

edit

this is the error it pops out.

[Wed Jul 01 16:32:52 2015] [alert] [client 195.240.165.183] /home/jellyf1q/public_html/test/jellyweb/.htaccess: Invalid command '\xef\xbb\xbf', perhaps misspelled or defined by a module not included in the server configuration

hmmm realizing now it may be in the rewriterule of the last line, but not sure what i do wrong.

Dorvalla
  • 5,027
  • 4
  • 28
  • 45
  • The htacces file is in the root of the website so in the `/jellyweb/` folder, and i get the 500 on just the test site then (the original domain is unaffected, just on every link after `test/domainname.nl/jellyweb/`) when I do a check in the test folder, the subfolder jellyweb isn't showing then. – Dorvalla Jul 01 '15 at 11:37
  • Can you check your Apache error.log and see what is exact error for 500 in browser? – anubhava Jul 01 '15 at 13:38
  • updated the question with the error message – Dorvalla Jul 01 '15 at 14:34

1 Answers1

0

I solved it, thanks to this post.

500 Internal Server Error when using .htaccess with RewriteEngine

It seemed, since it was saved as UTF8, it added some bytes to it, apache couldn't read. I resaved the file in asci and removed the php command line, resulting it working again. Thanks for the help, @Anubhava

Community
  • 1
  • 1
Dorvalla
  • 5,027
  • 4
  • 28
  • 45