开发者

301 redirect forms aspx to mvc page using web.config

Firstly, I have searched SO and google'd no luck

I am trying to redirect an existing forms websites Product.aspx page to the new MVC2.net page for the new version of the website.

I want to achieve this using the web.config as the example below:

<location path="Products.aspx">
<system.webServer>
  <ht开发者_开发知识库tpRedirect enabled="true" destination="http://www.address.com/Products/Page" exactDestination="true" httpResponseStatus="Permanent" />
</system.webServer>

I believe the page specified in location path= needs to physically exist which it doesn't in the new mvc website for this to work.

Is there a way it can be achieved?


Your code looks fine. It's just that the <system.webServer> section is only read and interpreted by IIS 7.0 and higher. It won't work with Cassini nor IIS 6.0.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜