Multiple 301 Redirects on the same domain name
-
Hi,
I'd appreciate some advice ont he below.
I have a website, say www.site.co.uk that has just been redesigned using a new CMS. Previously it had URLs in the format /article.php?id=123, the new site has more friendly urls in the format /articles/article-slug.
I have been able to import the old articles into my CMS using the same article IDs and I have created a unique slug for each post. So now in my database, I have the article id (from the querystring) and a slug.
However, I have hundreds of old URLs indexed by Google in the format /article.php?id=123 and need to redirect these.
My plan was to do the following. 301 Redirect /article.php?id=123 to an intermediate page, in this case /redirect/123. On this intermediate page I would do a database lookup for the article slug, based on the ID from the querystring, create a new URL and perform a second 301 redirect to my new URL E.g. /articles/article-slug-from-database.
Whilst this works and keeps the site usable for visitors the two 301 redirects do worry me, as I don;t want Google indexing lots of /redirect/[article id] urls.
The other solution is to generate hundreds of htaccess redirect rules that map old url to the new url. The first solution is much cleaner, but the two 301's worry me. Will Google work this out on it's own, is there a better way?
Any advice is much appreciated.
Cheers
Rob
-
Great call, I hadn't thought of that. Will go that a go definitly. Cheers
-
Hi Rob,
I do not recommend the second option (using htaccess) it's a worse abuse of Apache than described above as it would have to do that for every file request (gif|html|js|css|etc)
So my solution for you is to httpd.conf and RewriteMap either by using prg: map or txt: map.
my recommendation will of course be prg: map where you can query your database
For your help http://httpd.apache.org/docs/current/rewrite/rewritemap.html
Cheers!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
301 Redirect from query string to new static page
If i want to create a redirect from a page where the slug ends like this "/?i=4839&mid=1000&id=41537" to a static, more SEO friendly slug like "/contact-us/", will a standard 301 redirect suffice? Thanks, Nails
Intermediate & Advanced SEO | | matt.nails0 -
301 Redirecting from domain to subdomain
We're taking on a redesign of our corporate site on our main domain. We also have a number of well established, product based subdomains. There are a number of content pages that currently live on the corporate site that rank well, and bring in a great deal of traffic, though we are considering placing 301 redirects in place to point that traffic to the appropriate pages on the subdomains. If redirected correctly, can we expect the SEO value of the content pages currently living on the corporate site to transfer to the subdomains, or will we be negatively impacting our SEO by transferring this content from one domain to multiple subdomains?
Intermediate & Advanced SEO | | Chris81980 -
What are the pros & cons of recycling an old domain name?
Hi, Old domain name is about books and book buyback. It had about 1000 pages at one time, been around since 2006, and still shows in Open Site Explorer as 86 links from from 46 domains, PA 43 DA 35, spam score of 4. The 4 evidently relates to low number of internal links and no contact info. The domain name's ownership hasn't changed, but for the last year has either not been up at all or only the homepage in the last couple of months. Now the idea is to maybe re-purpose it for place rating content... no more book content... totally different subject matter. Is this an organic search advantage or would it be better to start fresh with a new domain name? Is Google going to have a harder time seeing it as relevant for a new subject (with good new content) or seeing a new site as important? Thanks... Darcy
Intermediate & Advanced SEO | | 945010 -
301 Redirect / Canonical loop on home page?
Hi there, My client just launched a new site and the CMS requires that the home page goes to a subfolder - clientsite.com/store. Currently there is a redirect in place such that clientsite.com -> clientsite.com/store. However, I want clientsite.com to be the canonical version of the URL. What should I do in this case, given that there is now a loop between the redirected page and the canonical page?
Intermediate & Advanced SEO | | FPD_NYC0 -
When should you redirect a domain completely?
We moved a website over to a new domain name. We used 301 redirects to redirect all the pages individually (around 150 redirects). So my question is, when should we just kill the old site completely and just redirect (forward/point) the old domain over to the new one?
Intermediate & Advanced SEO | | co.mc0 -
301 Redirecting Multiple Domains
I have several complete websites with blogs setup for different geo locations and was considering forwarding them all to one domain directly would greatly benefit ranking. The blogs are all linked together and that is where most of the links come from. Would I benefit in 301 Redirecting the domains?
Intermediate & Advanced SEO | | WindshieldGuy-2762210 -
301 redirect to multiple domain
Hi guys, I have a domain A, B and C. The domain A was an association of two business and they are about to split. Parts of domain A are going to be redirect to domain B, but some content belong to the domain C. So my question : Is it possible to 301 redirect some pages from A to B and some other pages from A to C and if yes, what would be the impact on SEO ? Thanks a lot!
Intermediate & Advanced SEO | | StevePatenaude0 -
Managing Multiple Websites via Add-On Domain
Hey SEOMOZ community, I've always been curious about whether or not hosting multiple websites through an 'add-on' domain has positive/negative effects on SEO for websites. Currently, I'm hosting 5 sites through an add-on domain at Hostgator.com. Is this a poor way to set-up my sites or is this OK?
Intermediate & Advanced SEO | | NiallSmith0