Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am trying to use a 301 redirect to direct users and bots to my new site but when I put the .htaccess live i keep getting a 500 internal error shown.

The site is actually a subdomain which i want to redirect to another subdomain on another site. I'm not sure if that's relevant but I thought I should include this information.

The web server I'm using is Apache and this is the htaccess code I'm using:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.blog.mysite.co.uk/$1 [R=301,L]

Any idea what might be wrong with this?

share|improve this question

2 Answers 2

not sure why it wasnt working but got in contact with the host and this is the solution they provided.. put it in the httpdocs folder, works fine

Redirect 301 / http://blog.example.co.uk 
share|improve this answer
1  
Redirect is in mod_alias, whereas RewriteRule is in mod_rewrite, so maybe mod_rewrite wasn't enabled - as Su' suggested? But you are also redirecting to a different URL than in your rewrite example above. –  w3d Jul 4 '12 at 13:41

Not guaranteed this is it, but try removing a line at a time until the error stops. That'll help you see which particular bit is causing the problem.
Getting a 500 from htaccess is sometimes a sign you're trying to do something you're not allowed to. Is mod_rewrite actually enabled, for example? The same for the Options line; If the server isn't configured with AllowOverride Options then it might be the FollowSymLinks line.

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.