帮助简单的mod_rewrite需要

我的网站使用mod_rewrite来查找网站中的大部分url。 例如。

domain.com/contact.htm

domain.com/product/details.htm

我有domain.com/contact.htm工作了很长时间,很简单,但不幸的是,我不能为我的生活让子文件夹重写工作,以便我可以去domain.com/product1/about.htm没有它带我直接到404页面。 这里是我的.htaccess的摘录。

 RewriteRule ^product1/([^/]+).htm$ /product1/index.php?p=$1 [L] #Even hardcoded isn't working... RewriteRule ^([^/]+)/([^/]+)/([^/]+).htm$ /$1/$2/index.php?p=$3 [L] RewriteRule ^([^/]+)/([^/]+).htm$ /$1/index.php?p=$2 [L] RewriteRule ^([^/]+).htm$ /index.php?p=$1 [L] 

这些规则在http://martinmelin.se/rewrite-rule-tester/上正常工作,但在实践中似乎从未奏效。 我想在这方面得到一些帮助。

编辑:仅供参考,这是位于domain.com的根www文件夹中的单个.htaccess文件。

谢谢。

呵呵!….好吧,apache显然不喜欢我在RewriteEngine On子文件夹中有一个.htaccess文件,即使没有任何规则。 我删除了RewriteEngine On ,它工作。 巴姆。 2晚上消失了。

无论如何,谢谢你们