简体   繁体   English

IIS重写不起作用

[英]IIS Rewrite Not Working

I'm trying to get URL rewriting working but having problems. 我正在尝试使URL重写正常工作,但是有问题。 I have several rules set up with BlogEngine.NET and I want to redirect several pages to a "Coming Soon" page. 我通过BlogEngine.NET设置了多个规则,并且希望将多个页面重定向到“即将推出”页面。 Despite being able to access a valid page at mydomain.com/page/coming-soon.aspx by typing it directly, if I try to access it via mydomain.com/category.aspx, the rule below does not work - I just get a 404 that '/page/coming-soon.aspx' does not exist. 尽管可以通过直接输入来访问mydomain.com/page/coming-soon.aspx上的有效页面,但是如果我尝试通过mydomain.com/category.aspx来访问它,则以下规则不起作用-我得到了404的“ /page/coming-soon.aspx”不存在。

  <rule name="Coming Soon4" stopProcessing="true">
      <match url="^category.aspx/?$" />
      <action type="Rewrite" url="page/Coming-Soon.aspx" />
  </rule>

您不是要type="Redirect"而不是Rewrite吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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