【问题标题】:IIS 7 Redirect for Apache URL containing ";jsessionid="包含“;jsessionid=”的 Apache URL 的 IIS 7 重定向
【发布时间】:2012-10-05 10:30:29
【问题描述】:

我们正在将现有的 Apache 托管网站替换为 ASPX IIS 7.5 托管网站。

目前,Google 显示了几个子页面结果(相对于主站点),其中子页面 (Apache) 链接看起来像这样......

http://mysite.co.uk/mypage.html;jsessionid=D4F2C4D93229A451BCA886061501C777

我希望 IIS 将此链接 (301) 重定向到类似这样的内容...

http://mysite.co.uk/anotherpage.aspx

我可以在 IIS 中创建一个 301 HTTP 重定向,以将“mypage.html”重定向到“anotherpage.aspx”,但是当“mypage.html”的传入请求还包含“;jsession=.. 。”。

我查看了重定向通配符,但似乎无法获得正确的结果。

任何建议将不胜感激!

【问题讨论】:

    标签: iis http-redirect


    【解决方案1】:

    我用IIS URL Rewrite 解决了这个问题。以下示例规则将解决我上面描述的问题...

    <rewrite>
        <rules>
            <rule name="mypage">
                <match url="^mypage.html" />
                <action type="Rewrite" url="anotherpage.aspx" appendQueryString="false" />
            </rule>
        </rules>
    </rewrite>
    

    【讨论】:

      猜你喜欢
      • 2011-06-24
      • 2011-05-30
      • 2012-12-21
      • 1970-01-01
      • 2011-08-16
      • 2012-09-14
      • 1970-01-01
      • 1970-01-01
      • 2011-11-16
      相关资源
      最近更新 更多