...

.htacces to redirect by user agent

brothercake
08-09-2002, 12:01 PM
What I'd like to do setup htacces to redirect *all* users to an /offline/ folder *unless* it's me - I can identify myself by the string token "brothercake" in my HTTP_USER_AGENT string


I know that mod_rewrite is needed for this, and I already have the .htacess for the /offline/ folder which turns the url rewriting engine off,to prevent an infinite loop, but what I'm looking for is the root .htaccess file that does the redirect in the first place.

I thought something like this

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} !^brothercake.*
RewriteRule [what goes here?] [R,L]

but I don't know what to put for the rule, or whether the rest of it is right anyway

Feyd
08-09-2002, 05:41 PM
Just replace [what goes here?] with the path to your redirect folder (virtual) and you should be good to go.

brothercake
08-09-2002, 10:58 PM
wow. i like it when that happens - nice and simple :)

thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum