![](/img/trans.png)
[英]What is the proper way to turn a bitmap around a certain point, with a certain degree?
[英]What's the proper way to determine whether a certain URL sits within a certain directory?
我的项目中有一个目录,我希望其中所有对网页的调用以及所有子目录都被转移到另一个网站。
例如。
如果目录为http:// localhost / MyProject / MyDirectory ,我希望将所有URL(例如http://localhost/MyProject/MyDirectory/MyFile.aspx)转移到另一个网站。
我不想为此使用IIS,因为还有一些与日期和内容有关的其他业务规则。 在那里,我想在母版页或global.cs文件中进行此操作。
我怎么知道请求是否真正在目录中。
我本来只是去
if(Request.Url.AbsoluteUri.contains(“ http:// localhost / MyProject / MyDirectory){Response.Redirect(” ...“)}}
但是我觉得这不是一个好的解决方案,因为它可能位于不同的域名等中。
您可以使用Request.Url.AbsolutePath
获取域名后的路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.