我已经修改了我的.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并输出错误。
我需要能够访问像下面这样的文件,但每个网址目前试图加载index.php。http://domain.com/about.htm
等
关于如何修改htaccess文件以使其正常工作,有什么建议吗?
发布于 2010-03-31 08:44:54
如果你想让文件胜过产品,你可以在另一个条件下折腾:
RewriteCond $1 !^index.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?([^/]+)$ index.php?c=home&m=details&seo=$1 [L,NS]...meaning指出,只有当请求的URI没有映射到文件时,它才应该被视为产品。
有这样的文件胜过产品并不可怕,除非你计划有像"something.html“和"dynamic.php”或"lenna.jpg“这样的产品名称。
https://stackoverflow.com/questions/2549408
复制相似问题