Forum Moderators: phranque

Message Too Old, No Replies

This .htaccess code gave an Internal 500 error to site

         

born2run

7:37 pm on Jun 6, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi I just added the following to .htaccess:

#RewriteCond %{HTTP_HOST} ^domain.xyz$ [OR]
#RewriteCond %{HTTP_HOST} ^www.domain.xyz$
#rewriterule ^(.*)$ [domain.com...] s[R=301,L]

And the server gave an internal 500 error. I had to delete these entries and the site is normal! Why? Kindly assist. Thanks!

born2run

7:39 pm on Jun 6, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Update: it was a typo so all is well!

lucy24

11:20 pm on Jun 6, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yup, and I can see it ;)

Incidentally, ahem, cough-cough, what's with
RewriteCond %{HTTP_HOST} ^domain.xyz$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.xyz$
? All you need is
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.xyz$

or, if you don't have subdomains to protect, just leave off the opening anchor. Escape the periods, though here it's a non-lethal error.