利用Apache手工屏蔽各种广告(无聊人士玩玩)
2012-07-01 05:17
435 查看
1.在hosts文件里对需要屏蔽广告的网站加上host
例如:
#屏蔽百度视屏广告:
127.0.0.1 a.baidu.com
127.0.0.1 baidutv.baidu.com
127.0.0.1 bar.baidu.com
127.0.0.1 c.baidu.com
127.0.0.1 cjhq.baidu.com
127.0.0.1 cpro.baidu.com
127.0.0.1 drmcmm.baidu.com
127.0.0.1 e.baidu.com
127.0.0.1 eiv.baidu.com
127.0.0.1 hc.baidu.com
127.0.0.1 hm.baidu.com
127.0.0.1 ma.baidu.com
127.0.0.1 nsclick.baidu.com
127.0.0.1 spcode.baidu.com
127.0.0.1 tk.baidu.com
127.0.0.1 union.baidu.com
127.0.0.1 ucstat.baidu.com
127.0.0.1 utility.baidu.com
127.0.0.1 utk.baidu.com
127.0.0.1 focusbaiduafp.allyes.com
2. 设置apache转发,这里直接用默认路径改
<Directory "E:/Apache Software Foundation/Apache2.2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond $1 !(adimage.html)$
RewriteRule ^(.*)$ /adimage.html [L]
</IfModule>
</Directory>
这里会将所有adimage.html的页面都转发到?adimage.html
3.配置一下转发到的页面
4.效果图
例如:
#屏蔽百度视屏广告:
127.0.0.1 a.baidu.com
127.0.0.1 baidutv.baidu.com
127.0.0.1 bar.baidu.com
127.0.0.1 c.baidu.com
127.0.0.1 cjhq.baidu.com
127.0.0.1 cpro.baidu.com
127.0.0.1 drmcmm.baidu.com
127.0.0.1 e.baidu.com
127.0.0.1 eiv.baidu.com
127.0.0.1 hc.baidu.com
127.0.0.1 hm.baidu.com
127.0.0.1 ma.baidu.com
127.0.0.1 nsclick.baidu.com
127.0.0.1 spcode.baidu.com
127.0.0.1 tk.baidu.com
127.0.0.1 union.baidu.com
127.0.0.1 ucstat.baidu.com
127.0.0.1 utility.baidu.com
127.0.0.1 utk.baidu.com
127.0.0.1 focusbaiduafp.allyes.com
2. 设置apache转发,这里直接用默认路径改
<Directory "E:/Apache Software Foundation/Apache2.2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond $1 !(adimage.html)$
RewriteRule ^(.*)$ /adimage.html [L]
</IfModule>
</Directory>
这里会将所有adimage.html的页面都转发到?adimage.html
3.配置一下转发到的页面
<html> <body> <!--<image src="/adimage/psb.jpg">--> <?php echo "我卖广告我傻逼,哦也!"; ?> </body> <html>
4.效果图
相关文章推荐
- 利用Apache服务器屏蔽广告及IP段的一般方法
- 利用GZIP压缩网页(Tomcat,apache,iis)各种方法总结
- 利用hosts文件屏蔽应用广告
- 利用HOST屏蔽在线视频广告之地址
- 利用hosts文件屏蔽一些垃圾广告
- 利用stylist插件,简单两步屏蔽新浪微博上的广告
- 利用ssl证书+nginx屏蔽运营商垃圾广告的实现方式
- 利用StringEscapeUtils对字符串进行各种转义与反转义(Java)
- ubuntu系统用 chorme浏览CSDN如何 屏蔽 百度的恶性广告
- Google广告屏蔽插件adBlock
- Tomcat:利用Apache配置反向代理、负载均衡
- 搜索广告与广告网络Demand技术-探索与利用
- 利用Apache BeanUtils实现冗余字段同步和管理
- 关于屏蔽广告的chrome插件
- 使用hosts文件屏蔽广告, 访问一些网站
- Apache和Tomcat利用Proxy代理保持Session
- 屏蔽广告的方法
- 利用apache+svn+jenkins+maven 实现java环境的自动化构建和部署(四)(网内首发超详细版)
- 动手解决困扰自己的事情——记屏蔽网页广告
- ipsec屏蔽土豆广告 2011.7