如何从.htaccess规则中排除页面?

时间:2014-10-17 11:33:11

标签: .htaccess

这是我的.htaccess文件:

Options -Indexes 
RewriteEngine on
RewriteCond $1 !^(index\.php|css|images|jscript|user_guide|login|en|favicon.ico|uploads|script.php)
RewriteRule ^(.*)$ index.php/$1 [L]

我希望能够直接输入此地址:

mysite.com/system/application/views/req-php.php?_INPUT&f=xxx

1 个答案:

答案 0 :(得分:0)

您可以添加另一个否定RewriteCond以避免重写此新网址:

Options -Indexes 
RewriteEngine on

RewriteCond %{THE_REQUEST} !\s/system/application/views/req-php\.php\?_INPUT&f= [NC]
RewriteCond $1 !^(index\.php|css|images|jscript|user_guide|login|en|favicon.ico|uploads|script.php)
RewriteRule ^(.*)$ index.php/$1 [L]