简体   繁体   中英

asp net mvc domain redirect

I have a MVC web application and the url's are

abc.xy.com - for the rest of the world excluding China

abc.xy.com.cn - for China (.com doesn't work in China, so created this)

Everything is working fine with that, but I need something like:

If the user from China tries to load the url abc.xy.com then the application should redirect the request to abc.xy.com.cn

How can I achieve this domain redirection through the application.

Thanks in advance,

Amarnath.

Use Maxmind's free GeoIP database to check what country the client is in. They have a C# API that should work well with MVC Application.

For code referance check this URL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM