简体   繁体   English

我如何创建从WordPress(驻留在wsynth上)到Heroku托管的Rails应用的301重定向?

[英]How do I create 301 redirect from WordPress (hosted on wsynth) to a Rails app hosted on Heroku?

I have a website (example.com) that is a WordPress site hosted on WSYNTH. 我有一个网站(example.com),它是WSYNTH上托管的WordPress网站。 I am redesigning the site, same domain (example.com) in ROR hosted on Heroku. 我正在重新设计该站点,该站点与Heroku上托管的ROR中的同一个域(example.com)。

I have been told that for SEO purposes, once I point my domain to the ROR app on Heroku, all the old pages from the Wordpress site will go dark. 有人告诉我,出于搜索引擎优化的目的,一旦将我的域指向Heroku上的ROR应用程序,Wordpress网站上的所有旧页面都将消失。 (Makes sense.) But this would be very bad for SEO, since example.com will now have many URLs associated with it (created from the WP site) that are no longer valid. (有道理。)但这对SEO来说非常糟糕,因为example.com现在将具有与其关联的许多URL(从WP网站创建),这些URL不再有效。

I've heard that a 301 Redirect for those WordPress URLs will take care of this SEO issue. 我听说针对这些WordPress URL的301重定向将解决此SEO问题。 But how and where should I do this? 但是,我应该如何在何处执行此操作? Should I be installing a plugin in WordPress that will automate the redirects to the pages I want to send them to in the ROR/Heroku app?) 我是否应该在WordPress中安装一个插件,该插件将自动重定向到要在ROR / Heroku应用程序中发送给我的页面?)

Also, is it possible to keep some of those old WordPress URLs live? 另外,是否可以保留其中一些旧的WordPress URL?

DNS 域名解析

The 301 redirect is not the issue - you can use Wordpress itself to redirect to specific pages (using the simple 301 redirects plugin), or a better way will be to redirect your domain (with your DNS) to your Rails app, and then use the routes to handle any stray pages 301重定向不是问题-您可以使用Wordpress本身重定向到特定页面(使用简单的301重定向插件),或者更好的方法是将您的域(使用DNS)重定向到Rails应用,然后使用处理任何杂乱页面的路线

The world of "SEO" is highly overrated - Google is just a system which follows links. “ SEO”的世界被高估了-Google只是一个跟踪链接的系统。 If it cannot find a page, it removes it from its rankings; 如果找不到页面,则会将其从排名中删除; if it can find the page, it judges its on & off-site optimization to determine its relevance. 如果可以找到该页面,它将判断其现场和非现场优化,以确定其相关性。

This means the only thing you need to concern yourself with is ensuring you don't have any "holes" in your URLs. 这意味着您唯一需要关心的就是确保您的URL中没有任何“漏洞”。 The redirections essentially mean you will tell Google to follow a link to the new page 重定向实质上意味着您将告诉Google跟踪指向页面的链接

-- -

Redirections 重新导向

The first thing you need to do is ensure you have the new pages you wish to show on your site. 您需要做的第一件事是确保您希望在网站上显示新页面。 Preferrably, you'll want to make as many of them as identical to your previous URLS as you can. 最好,使它们尽可能与以前的URL相同。

Secondly, you can introduce redirects in your Rails routing system to give Google real pages when it visits the links for your Wordpress site: 其次,您可以在Rails路由系统中引入重定向,以便在Google访问您的Wordpress网站链接时提供真实页面:

#config/routes.rb
get '/your-old-post-name', to: redirect('/your-new-post-name')

This will mean you will have to create redirections for every wordpress post in your new Rails app - but should give Google the knowledge that those pages have changed, to which it will update 这意味着您将不得不在新的Rails应用中为每个wordpress帖子创建重定向-但应向Google提供这些页面已更改的知识,并将其更新为

暂无
暂无

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

相关问题 如何从 Heroku 中托管的 Rails API 应用程序在浏览器中设置 cookie,该应用程序在 Netlify 中托管的 React 应用程序中运行前端? - How can I set cookies in a browser from a Rails API app hosted in Heroku running the frontend in a React app hosted in Netlify? 我如何开发自托管的Rails应用 - How do I develop self-hosted Rails app 从Heroku Rails应用程序重新路由到AWS托管资产 - Rerouting to AWS hosted assets from a Heroku Rails app 将heroku托管的Rails应用程序连接到我创建的单独服务 - Connecting heroku hosted rails app to a separate service that I created 从Heroku上托管的Rails应用发送大量定制电子邮件 - Sending mass, customized emails from a Rails app hosted on Heroku 如何清除每次访问位于Heroku上的Rails应用程序时保存并显示的默认用户名? - How to clear a default username that is saved and shown everytime I visit my rails app hosted on heroku? 如何为heroku上托管的Rails应用程序设置QuotaGuard Static? - How to setup QuotaGuard Static for a Rails app hosted on heroku? 我的应用程序在Heroku中托管的ruby on rails中出错 - Error in my app in ruby on rails hosted in heroku 如何通过https从Heroku上托管的Rails应用程序访问Google云端硬盘文档内容? - How to access Google Drive document contents through https from a Rails app hosted on Heroku? 如何在heroku上托管的ruby on rails项目中实现弹性搜索? - How do I implement elastic search in a ruby on rails project hosted on heroku?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM