how do i make a htaccess file to redirect visitors?

It needs to go in the directory you want to redirect visitors from, so if you're intending on redirecting them from any page on the site it should go in your website's root directory.

If you do that, you'll need to make sure your rule only redirects when users are not seeing the temporary page though, otherwise they'll never see anything and the page will just time out.

I think thats right anyway, been a while since I messed with URL rewriting. :)
 
paulsheff said:
Code:
RewriteRule ^old_page.htm$ new_page.htm [R=302,NC,L]
ok, how will i know if it's working or not?
i mean in theory it shouldnt affect my own access right?

edit: also, wouldn't this just direct visitors away from a single page? i need to restrict access to the entire site while i am working on it. how would i do this?
 
Last edited:
Rewrite everything to a certain URL provided the user has an IP that isn't yours. You'll need a RewriteRule for the first part and a RewriteCond for the second.
 
Back
Top Bottom