Redirection form IIS with web.config to PHP
I've wrote this file for redirection and I don't understand why the sixth redirection does not work. all the other ones do work.
I'm really new to IIS and ASP (and intend to keep myself like this :) ) but need some clarification about this so I could move on.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="r1">
<match url="contact.aspx"/>
<action type="Redirect" redirectType="Permanent" url="http://www.doctornestor.co.il/contact/"/>
</rule>
<rule name="r2">
<match url="send2friend.aspx"/>
<action type="Redirect" redirectType="Permanent" url="http://www.doctor开发者_C百科nestor.co.il/contact/"/>
</rule>
<rule name="r3">
<match url="admin/login.aspx"/>
<action type="Redirect" redirectType="Permanent" url="http://www.doctornestor.co.il/wp-admin/"/>
</rule>
<rule name="r4">
<match url="members-club/join_member.aspx"/>
<action type="Redirect" redirectType="Permanent" url="http://www.doctornestor.co.il/newsletter/"/>
</rule>
<rule name="r5">
<match url="articles/dynamic-web-archive.aspx"/>
<action type="Redirect" redirectType="Permanent" url="http://www.doctornestor.co.il/blog/articles-and-newsposts/"/>
</rule>
<rule name="r6">
<match url="articles/dynamic-web-articles.aspx?page_id=55&parent_id=0&pgnm=%D7%97%D7%92%D7%99%D7%9D"/>
<action type="Redirect" redirectType="Permanent" url="http://www.doctornestor.co.il/blog/%D7%93%D7%99%D7%90%D7%98%D7%94-%D7%91%D7%97%D7%92%D7%99%D7%9D/"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Your last rule (r6) is invalid. The URL pattern CANNOT include query string. Query String has to be matched separately, via conditions.
Here is correct rule:
<rule name="r6" stopProcessing="true">
<match url="^articles/dynamic-web-articles\.aspx$" />
<conditions>
<add input="{QUERY_STRING}" pattern="page_id=55&parent_id=0&pgnm=%D7%97%D7%92%D7%99%D7%9D" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://www.doctornestor.co.il/blog/%D7%93%D7%99%D7%90%D7%98%D7%94-%D7%91%D7%97%D7%92%D7%99%D7%9D/" />
</rule>
精彩评论