簡體   English   中英

.htaccess導致的404錯誤

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM