我正在使用mod重写,我是新手。我写了以下规则:
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/? index.php?company=$1&action=$2&type=$3&id=$4 [L,QSA]
我已经过测试,但它可以正常工作,但它不允许我显示图像,例如。
<img src="http://example.com/images/logo.gif">
因为它一直遵循重写规则并建议此页面不存在
如何将排除添加到某个目录,以便我可以将其用作image / js / css目录等。
非常感谢
答案 0 :(得分:1)
您最好只是排除与文件匹配的请求:
RewriteCond %{REQUEST_FILENAME} !-f # not if the request matches a real file
RewriteRule ^([^/]+)/...