簡體   English   中英

.htaccess mod_rewrite給500錯誤

[英].htaccess mod_rewrite giving 500 error

我有一個運行良好的.htaccess文件。 但是,我只是將網站移到了共享主機上,所以一切都停止了工作。

這是我的.htacces:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/preview/([^/]+)/?$ preview.php?c=$1&m=$2&i=$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/page/([^/]+)/?$ index.php?c=$1&m=$2&p=$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?c=$1&m=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?c=$1 [L]

我不確定,但我認為問題在於托管帳戶不在根目錄下。 這意味着我有一個域指向我的托管帳戶,但是此域www.website.com指向了托管帳戶上的/website文件夾。

錯誤消息是:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache Server at crstrains.com Port 80

在錯誤日志中什么也沒有生成。

我希望www.website.com/Policies等於www.website.com/index.php?c=Policies,而且過去也是如此。 不再。 我怎樣才能解決這個問題?

您能否嘗試在RewriteEngine On正下方添加RewriteBase /

您是否嘗試過在RewriteEngine on語句之后添加RewriteBase /website/指令?

Checkout rewritebase如何在.htaccess中工作,以獲取有關如何使用RewriteBase更多信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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