IIS中的动态到静态URL重定向

时间:2013-02-11 10:09:26

标签: url iis web-config

我想通过web.config将动态URL重定向到静态URL。但是现在我没有通过我上传的web.config文件获得任何重定向。动态网址如下:   - http://www.greatmathworksheets.com/?page=grade-worksheets-list&levelid=11 等等levelid = 12 等待重定向的静态URL如下所示   - http://www.greatmathworksheets.com/grade-based-curriculums-11 等等levelid = 12

请告诉我应该怎么做才能重定向网址。请帮帮我。

web.config文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="Rule 1">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^www\.greatmathworksheets\.com$" negate="true" />
                </conditions>
                <action type="Redirect" url="http://www.greatmathworksheets.com/{R:1}" />
            </rule>
            <rule name="Rule 2" stopProcessing="true">
                <match url="^index\.php$" ignoreCase="false" />
                <action type="Redirect" url="http://www.greatmathworksheets.com/" redirectType="Permanent" />
            </rule>
            <rule name="Rule 3" stopProcessing="true">
                <match url="^([a-z]+)$" ignoreCase="false" />
                <action type="Rewrite" url="?page={R:1}" appendQueryString="false" />
            </rule>
            <rule name="Rule 4" stopProcessing="true">
                <match url="^contact-us$" ignoreCase="false" />
                <action type="Rewrite" url="?page=contact-us" appendQueryString="false" />
            </rule> 
    <rule name="Rule 7">
            <match url="^grade-based-curriculum$" ignoreCase="false" />
            <action type="Rewrite" url="?page=grade_level_curriculum" appendQueryString="false" />
            </rule>
            <rule name="Rule 8">
                <match url="^activity-based-curriculum$" ignoreCase="false" />
                <action type="Rewrite" url="?page=skill_level_curriculum" appendQueryString="false" />
            </rule>        
    <rule name="Rule 13">
                <match url="activity-based-curriculums-(.*)" ignoreCase="false" />
                <action type="Rewrite" url="?page=worksheets-list&amp;levelid={R:1}" appendQueryString="false" />
            </rule>
            <rule name="Rule 14">
                <match url="grade-based-curriculums-(.*)" ignoreCase="false" />
                <action type="Rewrite" url="?page=grade-worksheets-list&amp;levelid={R:1}" appendQueryString="false" />
            </rule>

 <rule name="Rule 15" stopProcessing="true">
                  <match url="(.*)/$" ignoreCase="false" />
                 <conditions logicalGrouping="MatchAll">
  <add input="{QUERY_STRING}" pattern="page=inquiry" />
                       </conditions>
                <action type="Redirect"        url="http://www.greatmathworksheets.com/inquiry" redirectType="Permanent" />
            </rule> 
        </rules>
    </rewrite>
</system.webServer>
</configuration>

谢谢,

尼丁

0 个答案:

没有答案