2
我剛剛將我的網站上傳到GoDaddy主機,並遇到一些URL重寫問題。谷歌充滿了類似的抱怨,但沒有幫助其他人爲我解決問題的修復。Godaddy主機上的URL重寫
我的.htaccess文件看起來是這樣的:
DirectoryIndex index.php
AddDefaultCharset utf-8
RewriteEngine on
Options +FollowSymlinks -MultiViews -Indexes
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?path=$1 [L,QSA]
我得到重定向到的index.php如預期的處理,但對於http://example.com/products我的$ _GET數組是這樣的:
array(
[404;http://example_com:80/products] => ''
)
但應看起來像這樣:
array(
[path] => '/products'
)
我不明白這是什麼意思。
這裏是在谷歌中發現問題的人民共同的解決辦法:
添加
Options +FollowSymlinks -MultiViews
添加
RewriteBase /
添加perpending斜槓重寫規則的index.php
我的.htaccess最初有兩個,我給index.php加了斜槓,等了兩個小時,但它仍然是一樣的。
任何想法?