将公共IP重定向到域名

huangapple go评论70阅读模式
英文:

Redirect public ip to domain name

问题

我需要的是,当有人在浏览器中输入我的ASP.NET MVC / C#网站的公共IP时,用户被重定向到域名。

谢谢

问候

例如,如果我输入142.250.0.139,浏览器会重定向到google.com。我需要确切地这样发生。

英文:

I need that when someone enters my ASP.NET MVC / C# website typing its public ip in the browser, the user is redirected to the domain name.

Thanks

Regards

For example if I write 142.250.0.139, the browser redirects to google.com. I need that exactly to happen.

答案1

得分: -1

只需在页面加载时重定向。如有需要,可以测试是否来自IP地址或域名。

英文:

Just redirect on page load. You can test for if it came from ip address or domain if needed.

huangapple
  • 本文由 发表于 2023年6月29日 03:30:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/76576192.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定