【发布时间】:2011-02-02 17:06:29
【问题描述】:
我已经修改了我的 .htaccess 文件,使其具有以下语句
RewriteCond $1 !^index.php$
RewriteRule ^/?([^/]+)$ index.php?c=home&m=details&seo=$1 [L,NS]
这让我可以像这样使用产品 URL:http://domain.com/product_name
但是,当尝试访问与 index.php 处于同一级别的文件时,它总是调用上面的 RewriteRule 并出错。
我需要能够访问如下文件,但当前每个 URL 都尝试加载 index.php。
http://domain.com/about.htm
http://domain.com/terms.htm
http://domain.com/robots.txt
等等
关于如何修改我的 htaccess 文件以使其正常工作的任何建议?
【问题讨论】:
-
如何区分文件和产品名称?文件会有
.htm之类的扩展名吗? -
是的,文件有扩展名,而产品没有。
标签: apache .htaccess mod-rewrite