我们已将网站移至新的托管服务提供商,并创建了一个新数据库并在其中导入了旧数据库。当我们访问该网站时,我们收到由.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/