通过.htaccess禁用servertokens打破了网站

时间:2014-11-29 23:14:44

标签: apache .htaccess server

我已将以下代码添加到我网站根文件夹中的.htaccess文件中:

# Disable server signature
ServerTokens ProductOnly
ServerSignature Off
# END SCCC    

导致我的网站崩溃:

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

删除servertokens行,它按预期工作并删除签名。

我应该如何禁用servertokens?如果我禁用签名,我甚至需要吗?

1 个答案:

答案 0 :(得分:3)

您只能在服务器配置(httpd.conf)中使用ServerTokens
http://httpd.apache.org/docs/current/en/mod/core.html#servertokens

.htaccess

ServerSignature即可