htaccess 404 redirect help in IE

I am trying to get my .htaccess file to work with IE. It seems to work for with FF. Here is what I have:

ErrorDocument 404 /404.html

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L] 

Open in new window

Who is Participating?
Do I need to surround this with <IfModule mod_rewrite.c> and  </IfModule>?
You do not;...i think.  to what i can see _ i believe at the very least the conditional statement and redirect are right format. Have you tried to clear cache in IE to reflect new changes? Cd& is extremely knowledgeable - have you tried his suggestion? My only concern is adding [L] flag for a stop.

You might also account for index.html. This works for me. But i have my rewrites at a global scope:
RewriteRule ^/index\.html$ [R=301,L]

So for htaccess, i think the initial slash in pattern is removed:
RewriteRule ^index\.html$ [R=301,L]
.htaccess has absolutely zero to do with browsers.  it resides on the server, is executed by the server and it is totally transparent to the browser.

What is it you are trying to do?

BDC-NetAuthor Commented:
Here is the site I am working on:

I want to keep the domain with www. and I want it to redirect to a 404.html page when someone types in a url that doesn't exist.

Any help would be appreciated.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[nc]
RewriteRule ^(.*)$$1 [r=301,nc]
ErrorDocument 404 404.html

Open in new window

BDC-NetAuthor Commented:
Do I need to surround this with <IfModule mod_rewrite.c> and  </IfModule>?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.