Mobile app version of vmapp.org
Login or Join
RJPawlick198

: Redirect a URL to another URL with IIS 7.5 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

@RJPawlick198

Posted in: #Iis7 #Redirects #Url

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>

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @RJPawlick198

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

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).

10% popularity Vote Up Vote Down


 

@Dunderdale272

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.*" />.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme