1

I have the following rule in my .htaccess file:

RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

I want to redirect requests to the www version of my site. It doesn't work when I tried on Internet Explorer 6...haven't tried on other versions of i.e. It works for chrome and firefox.

Any ideas why this could happen and how to solve? Thanks much

Lekensteyn
  • 6,241
  • 6
  • 39
  • 55
berto77
  • 111
  • 1
  • IE should not recognise .htaccess rules, Apache should. Maybe IE6 does not know how to do `Location:` redirects. What did you get? A blank page? – Lekensteyn Mar 23 '11 at 18:49
  • 1
    First I see a flash in the location bar: http ://example.com, then it just goes to google search result page with example.com as the query – berto77 Mar 23 '11 at 18:51
  • You may also want to turn on the [mod_rewrite log](http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog) to get an idea of what `mod_rewrite` is doing. – Andrew M. Mar 23 '11 at 18:53
  • Ok...good idea Red – berto77 Mar 23 '11 at 18:55
  • Unfortunately, I didn't set up any rewriteLog – berto77 Mar 23 '11 at 18:56
  • Is there any way to see the headers no IE6 and see what mess is it doing? No wonder people just don't support it anymore! :) – coredump Mar 23 '11 at 19:00
  • Are you actually typing a space in there between the p and the colon: "http ://example.com"? – Mark Wagner Mar 23 '11 at 19:50

1 Answers1

0

Looks like a DNS problem, newer browsers automatically try www.example.com if example.com fails, but IE immediately redirects to the search engine.

You need to set an A record for www., pointing to your servers IP address.

Lekensteyn
  • 6,241
  • 6
  • 39
  • 55