Redirect a URL to another URL with IIS 7.5

Redirect a URL to another URL with IIS 7.5 - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Redirect a URL to another URL with IIS 7.5 error on your web browser. Problem :


I have no idea why this isn't working. I've tried creating map rules and then rewriting and redirecting the URL. I've tried just redirecting it with a simple rewrite rule and no matter what, the only time I can get it to work is if I set the match URL to match this regex .*.



I'm trying to redirect webmail.example.com to mail.example.com. Seemed like it would have taken but a couple seconds; boy was I wrong. I'm thinking I must be doing something wrong with the regex, but I'm not sure what as when I test it it seems to work fine.



            <rule name="webmail" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*webmail.*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
</conditions>
<action type="Redirect" url="https://mail.example.com:8000" appendQueryString="false" logRewrittenUrl="true" />
</rule>

Solution :

You should setup a CNAME record in DNS that gives the alias webmail.example.com to mail.example.com. If you don't manage your own DNS server, then this may be able to happen at your registrar. If you are running your own internal DNS server, then you would need to edit the DNS on the appropriate machine. If this is handled by your webhost, then you would need to handle it through one of their interfaces (like cPanel or something else).



I assume that you don't have DNS access then - as this would take seconds to set up!



I see your filter is: <match url=".*webmail.*" />.



I may be totally wrong here but, you have a . before the first wildcard; surely it is looking for anything that includes this 'dot' in that position, which the URL you are working with doesn't; surely it should just be <match url="*webmail.*" />.


We hope that this article has helped you resolve the redirects, url, iis7 error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=