假设我的服务器看起来像这样:
/www/.htaccess
/www/index.php
/www/temp/index.php
我的个人IP(不是服务器的!)是127.0.0.1 *
(*好吧,这是不可能的,但为了争论......)
我想重定向(301/302)除IP之外的所有人/temp/index.php
我目前的代码如下:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
RewriteCond %{REQUEST_URI} !/temp/*$
RewriteRule \$ /temp/* [R=302,L]
但是我收到500错误。
答案 0 :(得分:-1)
没关系,这些htaccess文件难以使用。我在主index.php文件中使用了一些PHP代码。