Hello Everyone I have created the following script in my .htaccess file

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} domain.eu
RewriteCond %{REQUEST_URI} !^domain
RewriteRule ^(.*)$ domain/$1 [L]

This script should redirect domain.eu to the domain folder. But when I upload this script i get the internal server 500 error.

Any idea's what goes wrong?



How about:

Options +FollowSymlinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^domain\.eu 
RewriteCond %{REQUEST_URI} !^/domain/ 
RewriteRule ^(.*)$ /domain/$1 [L]

You are checking to see if the connection originates in the /domain/ folder, so you need to specify it with a slash.. otherwise you get a loop.. which may cause the 500 error.

| improve this answer | |

Try commenting out/removing the "Options" line.

You may not be allowed to alter the options in a .htaccess file with the current settings on the server.

If you have access to change the httpd.conf file you can allow this using the "AllowOverride Options" clause in the directory's configuration.

(Assuming this is Apache of course.)

| improve this answer | |

I guess we could be more useful if you gave us the exact line that appears in your error_log whenever you try calling that page. It could be simply that you didn't load the mod_rewrite module into apache first...

| improve this answer | |

You should check the server log which will tell you all about the error.

I agree with Andy, it's most likely the Options directive but the RewriteEngine directive can be problematic too.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.