htaccess - 适用于本地服务器,但不适用于远程服务器


htaccess - works on local, but not on remote server


我有这个页面和.htaccess的内容:

RewriteEngine On
RewriteRule ^images/(.*) public_html/images/$1 [PT,L]
RewriteRule ^temp/(.*) public_html/temp/$1 [PT,L]
RewriteRule ^css/(.*) public_html/css/$1 [PT,L]
RewriteRule ^js/(.*) public_html/js/$1 [PT,L]
RewriteCond %{REQUEST_URI} !^/public_html/
RewriteRule ^(.*)$ public_html/index.php/$1 [PT,L,NC,QSA]

问题是,上面的.htaccess代码在我的本地服务器上工作,但在远程服务器上不起作用。

例如:
此链接: http://test.gieromaniak.pl/gallery
应该看起来像这样工作:http://test.gieromaniak.pl/public_html/index.php/gallery

可能出了什么问题?

public_html文件夹是你自己创建的吗?如果是这样,那不是您的 Web 根目录,htaccess 应该位于 Web 根目录中,可能比 public_html 文件夹高一级。

也许您将整个public_html文件夹复制到您的虚拟主机,您应该刚刚上传public_html文件夹的内容

相关文章: