How do I create 301 redirect from WordPress (hosted on wsynth) to a Rails app hosted on Heroku? - ruby-on-rails

I have a website (example.com) that is a WordPress site hosted on WSYNTH.
I am redesigning the site, same domain (example.com) in ROR hosted on Heroku.
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. (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.
I've heard that a 301 Redirect for those WordPress URLs will take care of this SEO issue. 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?)
Also, is it possible to keep some of those old WordPress URLs live?

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
The world of "SEO" is highly overrated - Google is just a system which
follows links. 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. The redirections essentially mean you will tell Google to follow a link to the new page
--
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.
Secondly, you can introduce redirects in your Rails routing system to give Google real pages when it visits the links for your Wordpress site:
#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

Related

2 websites hosted in different servers (different hosts) but 1 domain

I have a Rails website hosted on Heroku.
I want to create a Wordpress website hosted on Godaddy.
The Rails website has specific data and has special functionality, about 40 pages. I want to have the Wordpress website on the same domain (NOT 2 different subdomains) so I can add articles and use existing WP functionality.
I can't do it in a different subdomain because it would be the equivalent of having a completely different website.
I do not want to code a CMS in Rails, that's why I want to use Wordpress. And I don't want to code PHP in a WP site to grab data from the Rails app. Any of these 2 options seem like I would be doing a lot of work, when I could just save myself weeks worth of work if I could just make the 2 sites play together under the same domain.
Is there a way to point the 1 domain to these 2 different websites? If so, how would I go about it? I've been searching online but haven't found a good reference.
This is possible if you're able to set up a reverse proxy or with Cloudflare Page Rules. Unfortunately, it looks like Cloudflare's functionality is only available to Enterprise users.

How to do multi-tenant support with custom domains and SSL on Heroku

My app allows users to create custom product landing pages.
I wish to setup this scenario:
Pages can exist on brand.myapp.com/offer-name, however I want to enable users to create landing pages using their own domain, for example brand.customerdomain.com/offer-name, which serves a page from my app.
I am unsure about the best way to do this. I know I can have users point a CNAME record to 'myapp.com', and then I add 'brand.customerdomain.com' as a Heroku custom domain. But is there a limit to the amount of custom domains I can add to Heroku? There will be thousands of these domains, so I don't know if this solution is feasible. I have had some success with this approach, however I get SSL browser messages when accessing the page from the user's domain.
In terms of SSL, I have a wildcard certificate installed on Heroku, for *.myapp.com.
Another way is to have a proxy server hosted elsewhere, and have users point a CNAME to something like 'proxy.myapp.com', which routes to my Heroku URL, however I haven't been able to get this to work on Nginx (on DigitalOcean), and haven't found any suitable guides (I don't have much Nginx knowledge).
The proxy approach I found here - https://mrvautin.com/enabling-custom-domain-for-saas-application-on-heroku/.
Cloudflare has a solution for this problem, however it's available to enterprise customers only, so I'd prefer to have my own solution - https://www.cloudflare.com/saas/.
What would be the ideal way to have multi-tenancy, with custom domains and SSL on Heroku?

redirect a subfolder from heroku to dedicated WordPress hosting

I have a simple site on heroku using Harp (not married to harp, just used something that can serve up static HTML.
We need to add a blog in a subfolder domain.com/blog instead of blog.domain.com for SEO reasons. Is there a way on Heroku to redirect just a subfolder?
I don't want to host, manage or deal with WordPress in any fashion. I'd like to avoid running any other blogging software. My preference is just to leverage the hosting solutions without losing SEO scores.
You'd have to do the redirect in Harp, but unfortunately Harp doesn't support server-side redirects. You can do a client-side redirect, though.

How to setup wordpress site and rails multiaccount site

I have TLD (www.example.com) and want to deploy rails 3 app (ex. app.example.com) what will have multiple accounts, each account with one subdomiain (test.example.com, support.example.com, ...).
I created tld with subdomain, changed DNS records, and everything is working. But, since there will be CNAME redirection from some other sites to specific subdomains and my default site is TLD (www.example.com) all CNAME redirects are going to main site instead of analogus subdomain!
Is there better way to integrate Rails and Wordpress? How to solve that? I'm searching for solution last two days.
Similar question: https://stackoverflow.com/questions/10405859/how-to-config-apache-passenger-for-wordpress-and-rails
If your ruby is in passenger mode, and your apache servicing all http queries you should be able to use the apache virtual server setup to redirect the queries for your rails apps accordingly, while leaving your Wordpress on the default web server.
I haven't done it with rails, but for Diaspora, (which is a ruby app) I have that running side by side with a Wordpress network with numerous subdomains off the TLD. The key might be that your TLD should be example.com, not www.example.com. (setup whichever you prefer to have wordoress on to redirect to the other)
Post some more details on your apache (or other web server environment) setup to achieve some better assistance if this doesn't help.
Yours for the cause of open source!

Sitemap for a site with a large number of dynamic subdomains

I'm running a site which allows users to create subdomains. I'd like to submit these user subdomains to search engines via sitemaps. However, according to the sitemaps protocol (and Google Webmaster Tools), a single sitemap can include URLs from a single host only.
What is the best approach?
At the moment I've the following structure:
Sitemap index located at example.com/sitemap-index.xml that lists sitemaps for each subdomain (but located at the same host).
Each subdomain has its own sitemap located at example.com/sitemap-subdomain.xml (this way the sitemap index includes URLs from a single host only).
A sitemap for a subdomain contains URLs from the subdomain only, i.e., subdomain.example.com/*
Each subdomain has subdomain.example.com/robots.txt file:
--
User-agent: *
Allow: /
Sitemap: http://example.com/sitemap-subdomain.xml
--
I think this approach complies to the sitemaps protocol, however, Google Webmaster Tools give errors for subdomain sitemaps: "URL not allowed. This url is not allowed for a Sitemap at this location."
I've also checked how other sites do it. Eventbrite, for instance, produces sitemaps that contain URLs from multiple subdomains (e.g., see http://www.eventbrite.com/events01.xml.gz). This, however, does not comply with the sitemaps protocol.
What approach do you recommend for sitemaps?
I recently struggled through this and finally got it working. See this thread for more details:
http://www.google.com/support/forum/p/Webmasters/thread?tid=53c3e4b3ab8d9503&hl=en&fid=53c3e4b3ab8d9503000497bd04ba63cf
Summary:
Use DNS verification to verify your site and all it's subdomains in one fell swoop
make the robots.txt on all your subdomains point to the main sitemap on your www domain
You may need to wait several days for Google to update it's cached copies of robot.txt on all your subdomains. It will still show errors until then.
Yes, the subdomain restriction is in the sitemaps.org spec, but, Google has put some exceptions in place:
Verify all subdomains within your Google Webmaster tools account
http://www.google.com/support/webmasters/bin/answer.py?answer=75712
cross-submission of sitemaps XML via Google Webmaster tools - if submitted via the root of your domain - will not throw errors for Google
Within the robots.txt of a subdomain you can point to sitemaps XML on other domains. there will be no cross submission errors - for Google
If you have a website that allows users to create sub-domain within your site, it is better for you to simplify the process by creating and submitting sitemaps for each subdomains by creating a single sitemap. This includes sitemap URLs for all your subdomain sites and saving this sitemap to a single location. But, to do this, all sites must be verified in webmaster tools. You can define one sitemap as:
http://example.com/sitemap.xml
Define all your sub-domain sitemaps for all your sub-domain URLs under this document tree.
You can define multiple sitemap files upto 50,000 URLs and 10 megabytes file size per sitemap. Sitemaps can be compressed using gzip to reduce the bandwidth. So, you don’t have any problem by defining the sitemap in this way.

Resources