Forum Moderators: phranque

Message Too Old, No Replies

Htaccess: All site redirected 301, except a specific file.

         

brakkar

9:50 am on Dec 15, 2011 (gmt 0)

10+ Year Member



Hi,
here is what I have on my htaccess:

RewriteEngine On
redirect 301 / http://www.example.com/


Still, I want a specific file, let's call it "example.html" excluded from the redirect.

What should I add in htaccess to shield example.com from beinr redirected ?

Thanks

lucy24

11:58 am on Dec 15, 2011 (gmt 0)

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



mod_rewrite [httpd.apache.org] is your friend.

The RewriteEngine is just sitting there raring to go, and then you turn around and use mod_alias instead :(

phranque

10:28 am on Dec 16, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



what lucy24 said!

you will want a RewriteCond directive that excludes your specific file and a RewriteRule directive to do the redirect.
there should be many examples in this forum...