-1

I have 2 domains on server2012, IIS8

www.abc.com and www.xyz.com

mailenable works like this way: www.xyz.com/mewebmail

I want users to access their mails like that: webmail.abc.com

this means I need to redirect (or urlrewrite) webmail.abc.com domain to www.xyz.com/mewebmail

I can redirect that. but visitors see that they are redirected. its the nature of redirection.

I dont want them to see, I need to rewrite the url. users still have to think that they are in www.abc.com but would actually be in xyz.

is that possible ? whatever I did I could not succeeded. none of the answers in the web keeps the url bar.

help please ?

MadHatter
  • 79,770
  • 20
  • 184
  • 232
user231500
  • 1
  • 1
  • 2
  • 2
    Since you couldn't be bothered to spell your title right, capitalize anything to aid readers of the question, or tell us what web server software you're using (IIS is not a safe assumption to make simply because it's Windows), I'm going to have to downvote and vote to close this question. I'll be happy to retract it when some better formatting and information is given. – Wesley Dec 10 '13 at 19:18
  • yeah, sorry. my post was really complicated to read. It was nice when using editor though :) I corrected now. If you don't like it please tell me, I'll try to edit again. – user231500 Dec 12 '13 at 08:52

1 Answers1

0

In IIS8 this may work following these steps:

You need to host both sites in the same IIS site on the same server, just have both www.abc.com and www.xyz.com as bindings for the single site.

Install the IIS Url Rewrite Module, then add a blank rule to rewrite all requests with webmail.abc.com as the host header to www.xyz.com/mewebmail. The section in your web.config should look similar to this:

<system.webServer>
    <rewrite>
        <rules>
            <rule name="webmail">
                <match url="(.+)" />
                <conditions>
                    <add input="{SERVER_NAME}" pattern="webmail\.abc\.com" />
                </conditions>
                <action type="Rewrite" url="mewebmail/{R:1}" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

You can only re-write URLs within a single site, if you need to switch sites, you have to use a redirect and the user will notice this in the address bar.

Peter Hahndorf
  • 14,058
  • 3
  • 41
  • 58