htaccess处理单个文件与其他文件不同

时间:2012-03-01 06:31:06

标签: .htaccess

我将htaccess配置为重写所有文件名

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^contst/(.*)$ /contst/index.html?doc=$1 [L,NC]

如何排除特定文件(contst / blahblah.php)被此代码选中?

1 个答案:

答案 0 :(得分:1)

RewriteRule ^contst/blahblah\.php$ - [L]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^contst/(.*)$ /contst/index.html?doc=$1 [L,NC]

RewriteCond $1 !^blahblah\.php$
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^contst/(.*)$ /contst/index.html?doc=$1 [L,NC]