我使用mod_rewrite和.htacces文件設置了一些簡單的url重寫規則,但是我遇到了一些問題。 如果我成立了.htacces這樣:mod_rewrite和相關網址
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
RewriteRule /index.html /index.php [L]
當我從瀏覽器中調用這個網址: http://localhost/~dave/mySite/index.html 我得到了一個404錯誤。
使用這種.htacces代替
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
RewriteRule /index.html http://localhost/~dave/mySite/index.php [L]
一切工作正常,我讓我期待的index.php頁面。 我是否被迫將用戶絕對URL作爲重寫的目標?這是一個Apache配置問題?
我使用Max OS X 10.6.2及其標準的Apache安裝。
你想在哪裏使用.htaccess文件? – Gumbo