Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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>
share|improve this question
    
This might be unrelated, but... I've had problems trying to redirect a webmail subdomain before (on Apache as it happens) on a shared host. A webmail subdomain had already been setup by the hosting provider and there was a conflict. –  w3d Sep 17 '12 at 21:32
add comment

2 Answers 2

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

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.