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.

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?

share|improve this question
    
Does domain.com/?p=520 work? Without the redirect, does domain.com/?p=520 forward to domain.com/?p=520 –  Dave Drager Sep 29 '09 at 16:24
    
In IE 301 Redirect fails to work for <pre>www.domain.com/?p=520</pre> –  Rory Hart Sep 30 '09 at 0:15

1 Answer 1

You need to change this in the Wordpress settings.

  1. Change General Settings => add www if you need it
  2. Change permalinks structure
  3. Clear cache
  4. Remove any plugins that might redirect
  5. Check your hosting panel for any redirects and disable
  6. Remove your rules and add the standard rules to the htaccess file

I wouldn't waste time with writing rules, it's better if you fix the problems in Wordpress and disable any redirect plugins, because that's what it sounds like

share|improve this answer

Your Answer

 
discard

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