我有一个完美运行的.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,并且过去常常这样做。不再。我该如何解决这个问题?
答案 0 :(得分:2)
你能尝试添加吗?
RewriteBase /
正好在下面
RewriteEngine On
答案 1 :(得分:2)
您是否尝试在RewriteBase /website/
声明后添加RewriteEngine on
指令?
结帐How does rewritebase work in .htaccess,了解有关如何使用RewriteBase
。