1
我需要关闭整个站点,所以我想将所有请求都路由到登录页面。 mod_rewrite是什么样子的?我的指令在Firefox中给我一个“永不完全”的错误。mod_rewrite所有内容到一个登录页面
RewriteEngine on
RewriteCond %{REQUEST_URI} !^[^.]*/$
RewriteRule ^(.*)$ /alert.php [R=301,L]
我需要关闭整个站点,所以我想将所有请求都路由到登录页面。 mod_rewrite是什么样子的?我的指令在Firefox中给我一个“永不完全”的错误。mod_rewrite所有内容到一个登录页面
RewriteEngine on
RewriteCond %{REQUEST_URI} !^[^.]*/$
RewriteRule ^(.*)$ /alert.php [R=301,L]
你重定向到匹配重写模式的页面,所以当浏览器尝试要求它作为301重定向,它就会再次被重定向的结果(导致一个无限循环,Firefox是足够聪明通知)。你会想要添加一个例外规则,以避免这种情况:
# the conditions are implicitly combined
# with a logical AND
RewriteCond %{REQUEST_URI} !=/alert.php
RewriteCond %{REQUEST_URI} !^[^.]*/$
RewriteRule ^(.*)$ /alert.php [R=301,L]
mod_rewrite是什么样子的? – 2010-09-17 19:32:33