能用的iis7 301跳转
index301.htaccess 必须写到.htaccess后缀的文件里,
1.在iis7的URL Rewrite中右侧点击Import Rules导入.htaccess文件
把henghengw.com 跳转到www.henghengw.com其他链接不跳转
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^henghengw.com$ [NC]
RewriteRule ^(.*)$http://www.henghengw.com/$1[R=301,L]
</IfModule>
其实应该也可以试试直接在web.config里写规则
<rule name="index301" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^henghengw.com$" />
</conditions>
<action type="Redirect" url="http://www.henghengw.com/{R:1}" redirectType="Permanent" />
</rule>