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

  • 相关阅读:
    CORS详解
    JBoss 系列九十九:Rest WebService jBPM 6 集成演示样例
    atitit。浏览器缓存机制 and 微信浏览器防止缓存的设计 attilax 总结
    4G时代来临,运营商为谁搭台献唱?
    Pascal&#39;s Triangle II
    cocos2d-x 3.6版连连看载入资源
    SlidingMenu导入编译用法--Eclipse和IDEA
    【解决】hive动态添加partitions不能超过100的问题
    AngularJS clone directive 指令复制
    AndroidStudio文件夹结构视图讲解
  • 原文地址:https://www.cnblogs.com/zemliu/p/2571586.html
Copyright © 2011-2022 走看看