asp.net mvc 4 - IIS 7.5 URL Rewrite: Redirect Rule does not appear to work from old domain to new domain -
i trying understand why following rule created in iis not working when person tries enter site.
basically have old domain , new domain. going old domain redirected landing page on our new domain.
i using asp mvc4 site , have added bindings domains , updated dns well.
my rule is:
<rule name="http://www.olddomain.com landing page" patternsyntax="wildcard" stopprocessing="true"> <match url="*" /> <action type="redirect" url="http://www.new-domain.co.uk/landingpage" /> <conditions logicalgrouping="matchany"> <add input="{http_host}" pattern="http://www.olddomain.com" /> <add input="{http_host}" pattern="http://olddomain.com" /> <add input="{http_host}" pattern="http://www.olddomain.com/" /> <add input="{http_host}" pattern="http://olddomain.com/" /> </conditions> </rule>
at moment if enters old domain address redirect not anything, website loads if entering via new domain home page.
can tell me going wrong here?
update rule provided below still not seem work decided try , open olddomain address in fiddler see if see redirect or response. 200 http response , nothing more. makes me think rewrite rules being ignored have no idea why.
{http_host}
host name, , not include protocol or path. try changing rule this:
<rule name="http://www.olddomain.com landing page" patternsyntax="wildcard" stopprocessing="true"> <match url="*" /> <action type="redirect" url="http://www.new-domain.co.uk/landingpage" /> <conditions logicalgrouping="matchany"> <add input="{http_host}" pattern="^www\.olddomain\.com$" /> <add input="{http_host}" pattern="^olddomain\.com$" /> </conditions> </rule>
Comments
Post a Comment