Reputation: 207
I have two projects on my server on running at same ip.
I want to redirect; a.company.com/api/(.*) => **b.company.com/(.*)
Like that, but i want to keep b.company.com hostname is hidden. Its mean i want to rewrite it, not redirect.
Thanks.
Upvotes: 0
Views: 728
Reputation: 174
You will need to have the URL Rewrite module 2.0 loaded, which is available via the platform installer. this will allow you to do server-side URL rewriting.
I can't say exactly what your rules should be but if you do it at the site level you will get somthing like this in your web.config in the system.webServer section:
<rewrite>
<rules>
<rule name="rewrite" patternSyntax="Wildcard">
<match url="/api/*" />
<action type="Rewrite" url="/{R:1}" />
</rule>
</rules>
</rewrite>
You will need to use the correct capture groups to match your situation.
Upvotes: 1