Apache 在本地主机上测试时htaccess重写问题

Apache 在本地主机上测试时htaccess重写问题,apache,.htaccess,Apache,.htaccess,我正在运行OSX(10.6),Apache启用了.htaccess 在htaccess文件中,我有以下代码: Options +FollowSymlinks RewriteEngine on RewriteRule ^page/([A-Z0-9._%+-]+) index.php?page=$1 [NC] 这在我的外部服务器上运行得很好,并很好地重定向到index.php?page=whatever 但是,当从localhost/~james/In%20Progress/Vila%20Mani

我正在运行OSX(10.6),Apache启用了.htaccess

在htaccess文件中,我有以下代码:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^page/([A-Z0-9._%+-]+) index.php?page=$1 [NC]
这在我的外部服务器上运行得很好,并很好地重定向到index.php?page=whatever

但是,当从
localhost/~james/In%20Progress/Vila%20Maninga/page/which
进行本地测试时,我会被重定向到
localhost/~james/Users/james/Sites/In%20Progress/Vila%20Maninga/index.php?page=which
。出于某种原因,正在添加“
Users/James/Sites/

有人知道为什么会发生这种情况以及如何预防吗

非常感谢,


James不能100%确定这是问题所在,但请尝试将其添加到.htaccess文件中

RewriteBase /

(用你喜欢的任何路径代替
/

@James Doc:很高兴它有帮助:)