Mod rewrite Apache2.2上的奇怪行为重写
working.htaccess配置:Mod rewrite Apache2.2上的奇怪行为重写,mod-rewrite,apache2,Mod Rewrite,Apache2,working.htaccess配置: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_URI} ^thumbs/(.*)$ RewriteRule ^(.+)$ /index.php [L,QSA] /index.php脚本不必捕获对/thumbs/
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} ^thumbs/(.*)$
RewriteRule ^(.+)$ /index.php [L,QSA]
/index.php脚本不必捕获对/thumbs/文件夹的所有404查询。为什么top.htaccess配置工作,而bottom配置不工作
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !^/thumbs/(.*)$
RewriteRule ^(.+)$ /index.php [L,QSA]
Apache2.2.9,Debian,我想这是因为
RewriteCond %{REQUEST_URI} !^/thumbs/(.*)$
请求URI包含请求的URI路径,并且总是以斜杠开头
因此模式^thumbs/(.*)$
永远不匹配,因为它缺少前导的/
。但是另一个条件,^/thumbs/(.*)$
,应该匹配URI路径不以/thumbs/
开头的每个请求