Apache正在重写index.php,但未附加查询字符串

|| 我试图让.htaccess在我的本地主机上工作(我有Mac OS X 10.5)。我通过关注此类文章来启用.htaccess。但是,尽管现在正在进行重写,但是它无法正常工作。例如,重写规则之一是:
RewriteRule ^(home|faq|about|contact)$ index.php?section=$1 [QSA,NC]
因此,当我输入
http://localhost/~MyUsername/MyWebsite/home
时,应该显示
http://localhost/~MyUsername/Mywebsite/index.php?section=home
...,而是出现404错误,错误消息为\“在此服务器上找不到所请求的URL /Users/MyUsername/Sites/MyWebsite/index.php 。\“ 我的猜测是我的Apache配置中有错误(重写规则在我的在线主机上可以正常工作),但是如何解决却是我所不知道的。有任何想法吗?提前致谢。     
已邀请:
        尝试以下RewriteRule:
RewriteRule ^/(.*)/(home|faq|about|contact)$ /$1/index.php?section=$2 [QSA,NC]
您可以在此处测试重写规则-http://martinmelin.se/rewrite-rule-tester/     

要回复问题请先登录注册