htaccess redirect according to IP
Let's say my server looks like this:
/www/.htaccess
/www/index.php
/www/temp/index.php
And my personal IP (not the 开发者_如何转开发server's!) is 127.0.0.1*
(* ok, that's impossible, but for the sake of argument...)
I would like to redirect (301/302) everyone EXCEPT that IP to /temp/index.php
My current code looks like:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
RewriteCond %{REQUEST_URI} !/temp/*$
RewriteRule \$ /temp/* [R=302,L]
However I get a 500 error.
Never mind, these htaccess file are hard to work with. I used some PHP code in my main index.php file instead.
精彩评论