【发布时间】:2013-04-15 00:01:04
【问题描述】:
您好,我在 mac 上使用 apache,我已启用 php。我正在尝试使用 .htacess 重写我的网址。
http://localhost/~username/project/test to http://localhost/~username/project/index.php?url=test
But received 404 error - on retrieving url - http://localhost/~username/project/test .
But - this - http://localhost/~username/project/index.php?url=test - Php is working fine.
我的 .htacess 文件包含以下五行:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
我可以在 php 信息中的已加载模块中看到 mod_rewrite。我如何调试它以找出是否正在调用 .htaccess 。
我的 .htaccess 文件的路径是 - ~username/Sites/project/.htaccess。
【问题讨论】:
标签: macos .htaccess mod-rewrite apache2