我的测试服务器上有这个网站,它工作得很好,但是当我把它上传到 GoDaddy 服务器上时,重写似乎失败了。
这是 .htaccess 的相关部分
RewriteRule ^([A-Za-z0-9\-]+)$ $1.php
RewriteRule ^([A-Za-z0-9\-]+)/?$ $1.php
RewriteRule ^([A-Za-z0-9\-]+)/([0-9\-]+)$ $1.php?v=$2
RewriteRule ^([A-Za-z0-9\-]+)/([0-9\-]+)/?$ $1.php?v=$2
所以基本上,URL:www.site.com/page-one应该打开页面www.site.com/page-one.php。但事实并非如此。它抛出以下错误:
Not Found
The requested URL /page-one was not found on this server.
Additionally, a 404 Not Found error was encountered while trying
to use an ErrorDocument to handle the request.
任何和所有的帮助将不胜感激!