Home How can I redirect a subdomain request in ASP.NET MVC?
Reply: 0

How can I redirect a subdomain request in ASP.NET MVC?

Vinyl Warmth
1#
Vinyl Warmth Published in 2017-12-05 16:46:09Z

I need to redirect booking.domain.com to 'www.domain.com' in my MVC5 application.

I think I need to set up a redirect in Web.config but I'm unsure how to do it and test it locally, I've tried:

<rule name="Redirecton" patternSyntax="ECMAScript" stopProcessing="true">
     <match url=".*" />
     <conditions>
         <add input="{HTTP_HOST}" pattern="^booking$" />
       </conditions>
       <action type="Redirect" url="http://localhost:63817" />
 </rule>

Can anyone help?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.330453 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO