[英]404 error due to .htaccess
我将实时项目复制到一个子目录。 但是,当我尝试运行它时,它显示404错误。 我确实需要对.htaccess文件进行更改,但仍未显示/Publish/index.php页。
我检查文件和文件夹是否存在并具有755权限。 不知道为什么显示404错误。
这是我的.htaccess文件代码。
RewriteEngine on
RewriteBase /var/www/site/serp/httpdocs/
RewriteRule ^robots.txt /robots-development.txt
RewriteRule ^robots.txt /robots-development.txt
RewriteRule ^index.htm([^/]+)/$ /Publish/index.php?lang_value=$1 [NC]
RewriteRule ^index.php$ /Publish/index.php [NC]
RewriteRule ^index.htm$ /Publish/index.php [NC]
注意:-我无法重新启动apache服务器。 所以我不能在apache conf文件中添加任何内容。
您的RewriteBase
似乎是错误的,因为它应该是DocumentRoot
相对路径:
RewriteEngine on
RewriteRule ^robots\.txt$ robots-development.txt [L,NC]
RewriteRule ^index\.htm([^/]+)/$ Publish/index.php?lang_value=$1 [NC,L,QSA]
RewriteRule ^index\.php$ Publish/index.php [NC,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.