我只是想知道是否有必要包含RewriteEngine On和Rewrite Base /每次添加重写?例如,我想同时使用“从URL删除QUERY_STRING”和“在一天中的某些特定时段阻止对文件的访问^”(示例引用来自askapache.com)RewriteEngine强制所有重写?
从URL中删除QUERY_STRING在某些时段,以文件
RewriteEngine On
RewriteBase/
RewriteCond %{QUERY_STRING} .
RewriteRule ^login.php /login.php? [L]
块访问^
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
# If the hour is 16 (4 PM) Then deny all access
RewriteCond %{TIME_HOUR} ^16$
RewriteRule ^.*$ - [F,L]
我还能将它们组合成以下?
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
RewriteCond %{QUERY_STRING} .
RewriteRule ^login.php /login.php? [L]
# If the hour is 16 (4 PM) Then deny all access
RewriteCond %{TIME_HOUR} ^16$
RewriteRule ^.*$ - [F,L]
在此先感谢您的时间。
感谢乔恩,你的回答也解决了我的其他文件夹重定向问题。非常感谢您的意见。 – bernie 2013-02-19 00:02:18