Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004

    htaccess specific redirect

    Is there a way to make an htaccess redirect NOT apply to specific IPs?

    We want to work on a new version of the site while all other visitors are redirected to a tempory site, so something like

    redirect all *.*.*.* except (IP DESIGNER1), (IP DESIGNER2)

    thanks - Your Chinese Radio Online!

  2. #2
    I think, note think that something like this would do it for you, i havent tested it, just searched around google a little.

    I dont use .htaccess that much, so it might not be perfect...

    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{REMOTE_HOST} !^11\.11\.11\.11
    RewriteCond %{REMOTE_HOST} !^22\.22\.22\.22
    RewriteCond %{REQUEST_URI} !/alternate_site\.html$
    RewriteRule \.*$ /alternate_site.html [R=302,L]

    The Other way, if your using PHP is to have a file that you include in every page and if its not your IP get php to do a header('Location'); to push them to where you want them to be.

    Personally i would think .htaccess is better, but i would use php myself.
    Note to self: Add something funny!
    Search is your friend!

Posting Permissions

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