Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .htacces to redirect by user agent

    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

  • #2
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    403
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just replace [what goes here?] with the path to your redirect folder (virtual) and you should be good to go.
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    wow. i like it when that happens - nice and simple

    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •