【发布时间】:2014-07-19 06:49:49
【问题描述】:
我正在尝试找到一种方法从我的 mod_rewrite 权限中排除图像文件和 css 文件
Options +FollowSymLinks
RewriteEngine On
#SecFilterInheritance Off
ErrorDocument 404 /fourohfour.php
RewriteCond %{HTTP_HOST} ^(myurl\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !\.(?:css|png|jpe?g|gif)$ [NC,OR] #my attempt at excluding
RewriteRule ^articles/([^/]+)/([^/]+)/?$ /article.php?id=$1&articleTopic=$2 [QSA,L]
问题在于排除线不太准确,我需要帮助
如果我转到我的目录中未包含在我的 .htaccess 重写中的任何 phpscript.. 说 isntance www.myurl.com/articlelinks.php 我会被重定向到这个:
http://www./articlelinks.php
让事情更复杂:
如果我去: http://www.myurl.com/articles/1/Dorsal+and+Volar+Intercalated+Segment+Instability+(DISI+and+VISI) CSS 文件不加载
如果我去:
http://www.myurl.com/articles.php?id=1&articleTopic=Dorsal+and+Volar+Intercalated+Segment+Instability+(DISI+and+VISI) 正确的文档加载了 css 和图像
请帮忙?
【问题讨论】:
-
使用正向模式。您的情况下的否定模式在逻辑上是错误的。
标签: php css apache .htaccess mod-rewrite