【问题标题】:Switching current website to new Rails app - SEO redirecting best practices将当前网站切换到新的 Rails 应用程序 - SEO 重定向最佳实践
【发布时间】:2014-04-28 23:31:52
【问题描述】:

我刚刚为我的企业创建了一个新的 Rails 网络应用程序,但想保留旧域名以用于 google SEO 目的。如何将旧链接重定向到同一域中的新链接?

例如,我有这个旧页面...
http://www.horschgallery.com/photo/black-white-chicago-vertical/chicago-cityscape-photo-sears-tower-willis-tower.aspx

这将需要重定向到当前托管在 heroku 上的新页面 http://horschgallery.herokuapp.com/photos/chicago-cityscape-photo-sears-tower-willis-tower

但我想将 heroku 应用程序放在 horschgallery.com 域中(由于我需要更改我的服务器指向的 IP 地址,所以它还不存在) horschgallery.com/photos/chicago-cityscape-photo-sears-tower-willis-tower

【问题讨论】:

    标签: redirect heroku ruby-on-rails-4 seo


    【解决方案1】:

    将此代码粘贴到您的旧域中并输入域 url

    <script language=javascript>
    function redirect(){
      window.location = "http://example.com";
    }
    </script>
    
    <body onload="redirect()">
    
    </body>
    

    或点击这里 --> Changing Your URL Without Penalizing Your Search Engine Optimization

    【讨论】:

      猜你喜欢
      • 2011-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多