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?

user591
1#
user591 Published in April 25, 2018, 10:50 am

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.314714 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO