How to Redirect any subdomain request to main domain in asp.net

前端 未结 2 1711
长情又很酷
长情又很酷 2021-01-23 01:06

I\'m trying to redirect all subdomain requests for domain.com to www.domain.com and user must access all part of website only by enter to main domain and click on links , for ex

2条回答
  •  既然无缘
    2021-01-23 01:36

    For the subdomains, you can either redirect them using your web hosting's Control Panel, or if you have the subdomains setup on a server that you can remote into, use the URL Rewrite module in IIS Manager to redirect all requests for the subdomain to your www subdomain. Using URL Rewrite, you don't have to show an error page, the redirect will happen automatically.

    You're not going to be able to restrict users from accessing pages using links only.

提交回复
热议问题