【发布时间】:2011-01-14 15:27:44
【问题描述】:
我正在像这样重定向所有请求:
RewriteRule ^sitemap.xml$ sitemap.php?/ [QSA,L]
# the line below is the one I'm having trouble with
RewriteCond %{REQUEST_URI} !^market-reports$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php?section=$1 [QSA,L]
如您所见,我所有的传入链接都指向 index.php。但现在我想阻止一个人去那里。我以前从未写过自己的RewriteCond,所以我有点不确定我所做的是否正确。
基本上我想说的是:“如果传入的 URL 是文件、目录或 /market-reports/ 什么也不做。否则将 URL 发送到 index.php?section="
我做错了什么?谢谢
【问题讨论】:
-
RewriteRule ^something - [L]
标签: apache .htaccess mod-rewrite