我有一个网站,其中包含许多人们用来连接到该网站的 URL(使用 IIS 网站上的绑定,一切都按预期工作):
- http://www.sample.com
- http://sample.com
- https://www.sample.com
- http://xyz.sample.com
- http://oldurl.com
现在我想做的是让所有的 URL 都转到https://www.sample.com - 所以如果你输入“ http://xyz.sample.com ”或“sample.com”你应该去https://www.sample.com
问题是这样做的最佳机制是什么?我有一个可能的解决方案(我将把它作为这个问题的答案),但我觉得可能有另一种更好的解决方案可用。