【问题标题】:Redirect with 301 Permamnent redirect does not send url parameters使用 301 永久重定向的重定向不发送 url 参数
【发布时间】:2017-02-10 02:01:48
【问题描述】:

我的网站是http://tebim.ir

我决定创建一个新域并将我的网站移到那里,而不会失去我的谷歌排名。谷歌更改地址工具告诉我做 301 重定向到我的新域,我照做了。

现在重定向工作正常,但我的 url 参数(查询字符串)没有通过重定向发送。

例如浏览 www.old-domain.com/view.aspx?id=5047 会重定向到 www.new-domain.com/view.aspx。

?id=5047 被移除。

** 我使用 WebSitePanel CPanel 重定向了我的网站。这是重定向表单的图片:

怎么了?谢谢。

【问题讨论】:

    标签: asp.net redirect


    【解决方案1】:

    你需要使用 URl 重写

     <rule name="behdoctor" stopProcessing="true">
          <match url="tebim.ir$" />
          <conditions>  
            <add input="{QUERY_STRING}" pattern="Id=5047" />  
        </conditions>  
          <action type="Redirect" url="http://www.newdomain.com" redirectType="Permanent" />
        </rule>
    

    更多信息请查看this链接

    【讨论】:

    • 我应该在哪里写这个?项目是 asp.net webforms。
    • @Ali.Rashidi 在 Web Config 中
    • 谢谢,但它没有用。不会发生重定向。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-17
    • 2014-09-24
    • 2013-07-17
    • 1970-01-01
    • 1970-01-01
    • 2014-08-29
    • 1970-01-01
    相关资源
    最近更新 更多