zoukankan      html  css  js  c++  java
  • 利用Apache手工屏蔽各种广告(无聊人士玩玩)

    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.配置一下转发到的页面

    <html>
        <body>
            <!--<image src="/adimage/psb.jpg">-->
            <?php echo "我卖广告我傻逼,哦也!"; ?>
        </body>
    <html>

     4.效果图

  • 相关阅读:
    hdu4930 Fighting the Landlords(模拟 多校6)
    hdu4888 多校B 最大流以及最大流唯一推断+输出方案
    xUtils介绍 -- DbUtils、ViewUtils、HttpUtils、BitmapUtils
    java 读取properties文件
    poj1062昂贵的聘礼
    杭电 HDU 2717 Catch That Cow
    iOS使用自己定义字体
    Elasticsearch 2014年10月简报
    html 上下左右都居中
    Linux 比较判断运算(if else)
  • 原文地址:https://www.cnblogs.com/zemliu/p/2571586.html
Copyright © 2011-2022 走看看