我刚刚把我的网站上传到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'
)
我不明白这是什么意思。
以下是在谷歌中找到的解决人们问题的常用方法:
我的.htaccess最初有前两个,我在index.php索引等了两个小时,但还是一样。
有什么想法吗?