繁体   English   中英

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文件夹复制到了您的Web主机,您应该刚刚在其中上传了public_html文件夹的内容

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM