Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

4 Answers 4

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.

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

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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