大连集群智慧传媒有限公司
相关栏目







网站群系统级死链接处理方法 Script business

网站群系统级死链接处理方法

2016-08-03 00:00

网站群系统级死链接处理方法

2016-08-03    

 

现象:

扫描工具扫描出网站存在大量死链接,其中系统级的包括以下几类:

about:blank

空路径

*.htm

*.html

#

原因:

扫描工具误扫误报

解决方法:

修改WEB服务软件配置文件,将以上类型的文件返回http 200状态。

Apache:

1.修改httpd.conf和apache-host.tpl,在虚拟主机中添加以下配置:

RewriteRule /(about:blank)$ http://localhost/apacheerror/x.html [P,L]

RewriteRule /\*\.(htm|html)$ http://localhost/apacheerror/x.html [P,L]

RewriteRule /(\#)$ http://localhost/apacheerror/x.html [P,L]

RewriteRule /(.+/)$ http://localhost/apacheerror/x.html [P,L]

2. 重启Apache服务.

Nginx:

1.修改servercommon.conf和servercommon.conf.tpl, 添加以下配置:

location ~ (about:blank)$ {

return 200;

}

location ~ (#)$ {

return 200;

}

location ~ \*\.(htm|html)$ {

return 200;

}

location ~ (.+/)$ {

return 200;

}

2. 重启Nginx服务.

大连集群智慧传媒有限公司 关注微信
159-9855-7370
173-0411-9111
0411-83767788
543646
543646@QQ.com