移动后网站内部出现500错误

时间:2015-03-11 09:47:27

标签: .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

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

1 个答案:

答案 0 :(得分:0)

  

[3月11日星期三10:52:23.874485 2015] [核心:警报] [pid 79734] [客户   92.70.27.237:50770] /sites/deteakspecialist.nl/www/.htaccess:无效命令&#39; order&#39;,可能拼写错误或由模块定义   包含在服务器配置中

这很可能是因为您可能正在使用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

相关问题