网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

利用web.config设置IIS7主机301重定向准确方法

时间:2024-11-06 07:07:46

1、打开dreamweaver,建立一个新的xml页面,或者直接新建一个文本文档

2、复制以下的代码粘贴进去<?xml version="1.0" en罕铞泱殳coding租涫疼迟="UTF-8"?><configuration><system.webServer><rewrite><rules><clear /><rule name="sudu_rewritefunc_unifieddomainname" enabled="true" patternSyntax="ECMAScript" stopProcessing="false"><match url="(.*)" ignoreCase="true" negate="false" /><conditions logicalGrouping="MatchAll" trackAllCaptures="false"><add input="{HTTP_HOST}" matchType="Pattern" pattern="^xiaoxiaomayi\.com$" ignoreCase="true" negate="true" /></conditions><action type="Redirect" url="http://xiaoxiaomayi.com/{R:1}" appendQueryString="true" redirectType="Permanent" /></rule></rules></rewrite></system.webServer></configuration>

3、蟠校盯昂dreamweaver保存的时候把文件名设为“web.config”保存类型选择“所有文件”2、文本文档保存后把文件名改为“web.config”(记得把扩展名也改了)

4、最后将web.config上传到你的网站根目录就可以了。

© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com