web.config做http的301重定向到https及不带www的域名做301重定向到带www的域名

知识技术 2021-06-06 19:53 4558
转载请务必注明: 来源:《建站管家》https://www.df81.com/news/195.html

这个是老站点df82.com的web.config的伪静态及301重定向代码(包括内页死链的301重定向),

发上来备忘,主要是网站改版时,产生大量的死链,如果有简洁的写法再改进,等收录正常后,再去掉


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="towww" stopProcessing="true">
                    <match url="(.*)" ignoreCase="true" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{HTTP_HOST}" pattern="^df8s\.com$" />
                    </conditions>
                    <action type="Redirect" url="https://www.df8s.com/{R:0}" redirectType="Permanent" />
                </rule>
                <rule name="tohttps" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="true" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" />
                    </conditions>
                    <action type="Redirect" url="https://www.df8s.com/{R:1}" redirectType="Permanent" />
                </rule>
                <rule name="page301" stopProcessing="true">
                    <match url="^cn/guoqingcuxiao-n250.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/cloudhost/" />
                </rule>
                <rule name="page302" stopProcessing="true">
                    <match url="^tag/gongsiwangzhanjianshe/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/sites/" />
                </rule>
                <rule name="page303" stopProcessing="true">
                    <match url="^cn/baidubianjiqidivbiaoqian-n211.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/sites/allsites.asp" />
                </rule>
                <rule name="page304" stopProcessing="true">
                    <match url="^danzhou/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/sites/shop.asp" />
                </rule>
                <rule name="page305" stopProcessing="true">
                    <match url="^cn/news-n305.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/sites/mobile.asp" />
                </rule>
                <rule name="page306" stopProcessing="true">
                    <match url="^cn/licaiwangzhan-c292.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/sites/weifx.asp" />
                </rule>
                <rule name="page307" stopProcessing="true">
                    <match url="^cn/news-n205.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/customercenter/" />
                </rule>
                <rule name="page308" stopProcessing="true">
                    <match url="^cn/news-n256.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/mail/" />
                </rule>
                <rule name="page309" stopProcessing="true">
                    <match url="^cn/seorumenjiaocheng-n269.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/domain/" />
                </rule>
                <rule name="page310" stopProcessing="true">
                    <match url="^cn/aspmianfeikaiyuanjianzhanxitong-n234.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/" />
                </rule>
                <rule name="page311" stopProcessing="true">
                    <match url="^cn/javascriptyibudiaoyong-n302.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/miniprogram/" />
                </rule>
                <rule name="page312" stopProcessing="true">
                    <match url="^tag/shenwangzhanjianshegongzuoshi/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/ssl/" />
                </rule>
                <rule name="page313" stopProcessing="true">
                    <match url="^tag/bangongzidonghuaguanlixitong/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/Cloudhost.asp" />
                </rule>
                <rule name="page314" stopProcessing="true">
                    <match url="^cn/fangdichanwangzhanjianshe-c242.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/" appendQueryString="false" />
                </rule>
                <rule name="page315" stopProcessing="true">
                    <match url="^cn/jiazhengfuwugongsiwangzhan-c229.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/" appendQueryString="false" />
                </rule>
                <rule name="page316" stopProcessing="true">
                    <match url="^cn/zuoliuliangdefangfa-n280.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/twhost.asp" />
                </rule>
                <rule name="page317" stopProcessing="true">
                    <match url="^cn/jiazhuanggongsiwangzhanjianshe-c240.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/usa.asp" appendQueryString="false" />
                </rule>
                <rule name="page318" stopProcessing="true">
                    <match url="^cn/shimumenyewangzhan-c306.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/linux_host.asp" appendQueryString="false" />
                </rule>
                <rule name="page319" stopProcessing="true">
                    <match url="^tag/qiyewangzhanzhizuo/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/java.asp" />
                </rule>
                <rule name="page320" stopProcessing="true">
                    <match url="^tag/haikouwangzhanjianshe/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/basic.asp" />
                </rule>
                <rule name="page321" stopProcessing="true">
                    <match url="^cn/chajuwangzhan-c259.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/twolinevhost.asp" appendQueryString="false" />
                </rule>
                <rule name="page322" stopProcessing="true">
                    <match url="^cn/shipinwangzhan-c256.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/hostlist.asp" appendQueryString="false" />
                </rule>
                <rule name="page323" stopProcessing="true">
                    <match url="^cn/tianpinwangzhansheji-c257.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/hkhost.asp" appendQueryString="false" />
                </rule>
                <rule name="page324" stopProcessing="true">
                    <match url="^cn/maoyiwangzhanjianshe-c297.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/asp_net.asp" appendQueryString="false" />
                </rule>
                <rule name="page325" stopProcessing="true">
                    <match url="^cn/huanbao-c285.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/superg.asp" />
                </rule>
                <rule name="page326" stopProcessing="true">
                    <match url="^beijing/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/database.asp" />
                </rule>
                <rule name="page327" stopProcessing="true">
                    <match url="^tag/sanyazuowangzhan/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/customercenter/productprice.asp" />
                </rule>
                <rule name="page328" stopProcessing="true">
                    <match url="^cn/shipinwangzhan-c256.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/" />
                </rule>
                <rule name="page329" stopProcessing="true">
                    <match url="^huaqiangbei/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/twhost.asp" />
                </rule>
                <rule name="page330" stopProcessing="true">
                    <match url="^shatoujiao/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/usa.asp" />
                </rule>
                <rule name="page331" stopProcessing="true">
                    <match url="^baoting/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/linux_host.asp" />
                </rule>
                <rule name="page332" stopProcessing="true">
                    <match url="^cn/huanbao-c286.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/" />
                </rule>
                <rule name="page333" stopProcessing="true">
                    <match url="^luohu/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/cloudhost/" />
                </rule>
                <rule name="page334" stopProcessing="true">
                    <match url="^cn/anfangjiankong-c267.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/domain/" />
                </rule>
                <rule name="page335" stopProcessing="true">
                    <match url="^cn/baojianpinwangzhansheji-c303.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/mail/" />
                </rule>
                <rule name="page336" stopProcessing="true">
                    <match url="^cn/mysqlcuowu-n300.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/sites/" />
                </rule>
                <rule name="page337" stopProcessing="true">
                    <match url="^kunming/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/miniprogram/" />
                </rule>
                <rule name="page338" stopProcessing="true">
                    <match url="^cn/news-n206.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/ssl/" />
                </rule>
                <rule name="page339" stopProcessing="true">
                    <match url="^hefei/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/Cloudhost.asp" />
                </rule>
                <rule name="page340" stopProcessing="true">
                    <match url="^tag/qiyewangzhansheji/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/trademark/" />
                </rule>
                <rule name="page341" stopProcessing="true">
                    <match url="^tag/mianfeijianzhanxitong/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/sites/" />
                </rule>
                <rule name="page342" stopProcessing="true">
                    <match url="^cn/jianzhanguanjiajiyuthinkphp-n310.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/reg/" />
                </rule>
                <rule name="page343" stopProcessing="true">
                    <match url="^tag/haikouzuowangzhan/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/reg/forget.asp" />
                </rule>
                <rule name="page344" stopProcessing="true">
                    <match url="^cn/chongwu-c58-1.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/" />
                </rule>
                <rule name="page345" stopProcessing="true">
                    <match url="^aomen/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/2j.asp?id=2" />
                </rule>
                <rule name="page346" stopProcessing="true">
                    <match url="^bantian/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/2j.asp?id=3" />
                </rule>
                <rule name="page347" stopProcessing="true">
                    <match url="^xixiang/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/2j.asp?id=4" />
                </rule>
                <rule name="page348" stopProcessing="true">
                    <match url="^cn/waimaowangzhan-c299.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/2j.asp?id=5" />
                </rule>
                <rule name="page349" stopProcessing="true">
                    <match url="^qiongzhong/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/2j.asp?id=11" />
                </rule>
                <rule name="page350" stopProcessing="true">
                    <match url="^shenzhen/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/2j.asp?id=13" />
                </rule>
                <rule name="page351" stopProcessing="true">
                    <match url="^songgang/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/2j.asp?id=15" />
                </rule>
                <rule name="page352" stopProcessing="true">
                    <match url="^cn/flvshipinbofangdaima-n229.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=323" />
                </rule>
                <rule name="page353" stopProcessing="true">
                    <match url="^tag/weixinxiaochengxukaifa/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=320" />
                </rule>
                <rule name="page354" stopProcessing="true">
                    <match url="^cn/jiudianwangzhan-c272.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=243" />
                </rule>
                <rule name="page355" stopProcessing="true">
                    <match url="^cn/zhuangxiuwangzhansheji-c239.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=362" />
                </rule>
                <rule name="page356" stopProcessing="true">
                    <match url="^cn/seoruhegengxinwenzhang-n255.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/services/webhosting/" />
                </rule>
                <rule name="page357" stopProcessing="true">
                    <match url="^cn/shengwuyiyaowangzhan-c301.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=257" />
                </rule>
                <rule name="page358" stopProcessing="true">
                    <match url="^cn/gongzhonghaokaifa-n290.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=231" />
                </rule>
                <rule name="page359" stopProcessing="true">
                    <match url="^cn/news-n256.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=226" />
                </rule>
                <rule name="page360" stopProcessing="true">
                    <match url="^cn/qiyeyouxiang-a26.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=144" />
                </rule>
                <rule name="page361" stopProcessing="true">
                    <match url="^cn/zuowangzhansuoxuziliao-n252.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=77" />
                </rule>
                <rule name="page362" stopProcessing="true">
                    <match url="^cn/chayewangzhanzhizuo-c238.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=68" />
                </rule>
                <rule name="page363" stopProcessing="true">
                    <match url="^cn/baojianpinwangzhan-c304.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=66" />
                </rule>
                <rule name="page364" stopProcessing="true">
                    <match url="^cn/wangzhanweihutuiguang-a23.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=59" />
                </rule>
                <rule name="page365" stopProcessing="true">
                    <match url="^cn/sheying-c271.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=22" />
                </rule>
                <rule name="page366" stopProcessing="true">
                    <match url="^hangzhou/" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=18" />
                </rule>
                <rule name="page367" stopProcessing="true">
                    <match url="^cn/wangzhansuduman-n278.html" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="/faq/list.asp?unid=81" />
                </rule>
  &n                

点赞 (0)

收藏 (0)

本站部分信息来源网络,如有侵权,请联系QQ:1062129401删除。

上一篇: 《建站管家》二次开发文档

下一篇: SuperSlide横向滚动不完整的bug解决方法

请先登录后,再发表评论 ~ ~
发表评论
发表评论
发表帖子
广告位招租( ¥5 / 天 )
点击咨询
相关帖子

如果要判断文件是否存在,用函数 is_file(),如果要判断目录是否存在,用函数 is_dir()
用宝塔安装TP程序后,网站前台可以访问,后台无法访问,不是程序问题,而是web服务器环境配置问题(PHP配置),出现这种问题,一般是windows主机安装宝塔造成的,linux安装宝塔不会出现此错误
广告位招租( ¥3 / 天 )
点击咨询
广告位招租( ¥2 / 天 )
点击咨询
广告位招租( ¥1 / 天 )
点击咨询
最新帖子

小朋友,你爸爸是谁啊?这很单纯的,就像我们碰到别人会问:你吃过饭了吗?类似;许多人初次相识,经常会问:你是做什么的啊?你做什么,好像决定你收入的高低,你,资产的范围
1、升级框架到ThinkPHP8.0.3【要求PHP8.1+环境,推荐PHP8.1】 2、启用/禁用调试模式等小细节改进
后台点击生成站点地图 一直转圈圈没有反应,
在线客服