Tell me more ×
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 rewritng 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>

Thanks

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

1 Answer

I assume that you dont 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

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.