.htaccess - 网站移动后出现500个内部错误

标签 .htaccess error-handling internal-server-error

我们已将网站移至新的托管服务提供商,并创建了一个新数据库并在其中导入了旧数据库。当我们访问该网站时,我们收到由.htacces引起的500内部错误,但不知道为什么它不能在新服务器和旧服务器上运行。

您可以在以下位置找到该站点:http://deteakspecialist.nl.webhosting72.transurl.nl/

.htacces看起来像:

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName deteakspecialist.nl

RewriteEngine on
RewriteRule ^callme$ index.php?p=callme [L]
RewriteRule ^callmeok$ index.php?p=callmeok [L]
RewriteRule ^cart$ index.php?p=cart [L]
RewriteRule ^contact$ index.php?p=contact [L]
RewriteRule ^links$ index.php?p=links [L]
RewriteRule ^newsletter$ index.php?p=newsletter [L]
RewriteRule ^newsletterok$ index.php?p=newsletterok [L]
RewriteRule ^order$ index.php?p=order [L]
RewriteRule ^orderok$ index.php?p=orderok [L]
RewriteRule ^payment$ index.php?p=payment [L]
RewriteRule ^product/(.*?)/.*?$ index.php?p=product&i=$1 [L]
RewriteRule ^productgroup/(.*?)/.*?$ index.php?p=productgroup&i=$1 [L]
RewriteRule ^productgroups/(.*?)/.*?$ index.php?p=productgroups&i=$1 [L]
RewriteRule ^productimage/(.*?)/.*?$ /media/product/$1.jpg [L]
RewriteRule ^productimagethumb/(.*?)/.*?$ /media/product/thumb/$1.jpg [L]
RewriteRule ^productinfo/(.*?)/.*?$ index.php?p=productinfo&i=$1 [L]
RewriteRule ^productinfook/(.*?)/.*?$ index.php?p=productinfook&i=$1 [L]
RewriteRule ^project$ index.php?p=project [L]
RewriteRule ^search$ index.php?p=search&%{QUERY_STRING} [L]
RewriteRule ^service$ index.php?p=service [L]
RewriteRule ^sitemap$ index.php?p=sitemap [L]
RewriteRule ^Teak-tuinmeubelen$ index.php [L,NC]
RewriteRule ^terms$ index.php?p=terms [L]
ErrorDocument 404 /index.php?p=404
RewriteCond %{HTTP_HOST} ^deteakspecialist\.nl$ [OR]
RewriteCond %{HTTP_HOST} ^www\.deteakspecialist\.nl$
RewriteRule ^teakhouten\-tuinmeubelen\.php$       "http\:\/\/www\.teaktuinmeubelen\.nl\/teakhouten\-tuinmeubelen" [R=301,L]

我们在错误日志中看到的错误如下所示:
[Wed Mar 11 10:52:23.874485 2015] [core:alert] [pid 79734] [client 92.70.27.237:50770] /sites/deteakspecialist.nl/www/.htaccess: Invalid command 'order', perhaps misspelled or defined by a module not included in the server configuration

有人知道如何解决这个问题吗?

最佳答案

[Wed Mar 11 10:52:23.874485 2015] [core:alert] [pid 79734] [client 92.70.27.237:50770] /sites/deteakspecialist.nl/www/.htaccess: Invalid command 'order', perhaps misspelled or defined by a module not included in the server configuration



这很可能是由于您可能正在使用Apache 2.2而您的新主机可能正在使用Apache 2.4造成的,这有很大的不同。事情已经改变,您需要在迁移之前检查这些事情。
order deny,allow
deny from all
allow from all

这些行不再在Apache 2.4中使用。因此,您需要转换设置以使用新的Require all granted。旁注,您的规则似乎仍然有冲突。

主机很可能没有启用mod_access_compat。因此,这只会引发错误。只需检查并更新您的配置即可。

在移动站点之前,应始终检查主机上正在使用的软件版本。 包括PHP版本,Web服务器,数据库等的所有内容。因为错误的版本可能会破坏您的代码,因此您必须更正代码才能使其与该版本一起使用。

http://httpd.apache.org/docs/2.4/upgrading.html#run-time

关于.htaccess - 网站移动后出现500个内部错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28983174/

相关文章:

php - Symfony2中用于开发和生产的不同错误模板

apache - 将所有流量重定向到 https ://www. 目前我有两个版本 http://www 和 https://www

.htaccess - 从 http 重定向到 https 是否有加密

javascript - 需要一个赋值或函数调用,而是看到一个表达式React JS

error-handling - 使用 Sinatra 显示错误消息

php - 内部服务器错误 500 - session_start()

url 重写目录问题 (htaccess)

.htaccess - htaccess RewriteRule 重定向到父目录?

python - Google应用程序引擎本地主机服务器错误python

php - SQL 代码的内部服务器错误