Wordpress Rewrite Redirect Failure
Posted
by Rory Hart
on Stack Overflow
See other posts from Stack Overflow
or by Rory Hart
Published on 2009-09-29T13:22:17Z
Indexed on
2010/06/11
1:02 UTC
Read the original article
Hit count: 380
I'm helping a friend recover from the mess outsourcing a wordpress website caused him (mistake #1) and I have this weird error. The hosting he is using appears to be redirecting www.domain.com to domain.com (NFI why) automatically which works fine in every browser except IE (i know right!). So adding the first redirect fixed that, until I added the permalink redirect. Now when IE goes to an old wordpress link like http://www.domain.com/?p=520 the redirect fails.
RewriteEngine On
RewriteBase /
# Rewrite rule for wierd redirect issue
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^/?(.*)$ "http\:\/\/doman\.com\/$1" [R=301,L]
# Rewrite Rule for Wordress Permalinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
I tested this out with wget and it complains:
ERROR: Redirection (301) without location.
So it seems likely that IE is suffering from the same error (without the helpful error message). But I haven't a clue how to fix it. I am hoping that he will switch hosting companies but we will see. In the meantime any ideas?
© Stack Overflow or respective owner