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.效果图

  • 相关阅读:
    [USACO08FEB]酒店Hotel 线段树 BZOJ 1593
    有趣的数 zoj 月赛
    [ZJOI2008]生日聚会 BZOJ1037 dp
    借教室 差分+二分答案
    HackerRank
    旅行计划 记忆化搜索
    灾后重建 Floyd
    [USACO10OCT]湖计数Lake Counting 联通块
    [TJOI2013]循环格 费用流 BZOJ3171
    高斯消元
  • 原文地址:https://www.cnblogs.com/zemliu/p/2571586.html
Copyright © 2011-2022 走看看