Hi, I'm a bit new to URL rewrite feature of IIS 7.5 thus would sincerely appreciate your help on this one. Basically what I wanted to do is to ensure that all documents that used to be accessed via http://mysite.company.net (I changed the name for confidentiality
purposes but it follows this specific URL format), be accessible now on http://mysite2.company.net. A basic HTTP redirect rule works but we're basically tasked to use URL rewrite instead. I was hoping you could lend some help on this one. Here's how my code
looks like but somehow it fails. Oh by the way, we have one site created that hosts all URL Rewrites, and existing rules work for redirect on it, just mine won't work. This somehow doesn't work and when I try to access it on the browser to test, it gives me
a 403.14 Forbidden error. What's even funnier is that on top, it tells me "Server Error in Application "TEST". You see, we also have a site named "TEST", and by all indications, it appears that instead of redirecting to http://mysite2.company.net, it goes
to the "TEST" site which I have no access whatsoever. Your kind help is greatly appreciated!
Before doing that I would make sure that http://mysite2.company.net is working properly. From the errors above it sounds like there might be an issue or two with it.
Rick Barber
Please mark the replies as answers if they help or unmark if they don't.
akosikikit
5 Posts
URL rewrite issues with redirect
Aug 02, 2012 11:46 AM|LINK
Rick Barber
569 Posts
Re: URL rewrite issues with redirect
Aug 02, 2012 01:06 PM|LINK
This should do what you are asking:
<rewrite>
<rules>
<rule name="IISServerName.domain.com to nonstandard port" enabled="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(www\.)?mysite\.company\.net$" ignoreCase="true" />
</conditions>
<action type="Redirect" url="http://mysite2.company.net/{R:1}" />
</rule>
</rules>
</rewrite>
Before doing that I would make sure that http://mysite2.company.net is working properly. From the errors above it sounds like there might be an issue or two with it.
Please mark the replies as answers if they help or unmark if they don't.
OrcsWeb: Managed Windows Hosting Solutions
"Remarkable Service. Remarkable Support."
akosikikit
5 Posts
Re: URL rewrite issues with redirect
Dec 03, 2012 05:47 AM|LINK
Hi Rick,
My absolute appreciation for your post! this actually made it work. My apologies for the long overdue "thank you"!
More power!
Rick Barber
569 Posts
Re: URL rewrite issues with redirect
Dec 04, 2012 02:04 PM|LINK
You're welcome. I am happy to help.
Please mark the replies as answers if they help or unmark if they don't.
OrcsWeb: Managed Windows Hosting Solutions
"Remarkable Service. Remarkable Support."