3

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?

Thanks

4 Answers 4

2

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.

0

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.)

0

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...

-1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .