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 redirection help needed!
Hi all, So if we used to have a domain (let's say olddomain.com) and we had a new site created at newdomain.com how do we properly setup redirects page to page. Caveat, the urls have changed so for instance the old page oldomain.com/service is now newdomain.com/our-services on the new site. Do we need to have hosting on the old site? Do we need to setup individual 301s for each page corresponding to the new page? Just looking for the easiest way to do this CORRECTLY. Thanks, Ricky
Intermediate & Advanced SEO | | RickyShockley3 -
How long does Google take to completely authorise 301 redirect?
Will 301 redirect will have immediate impact once the website or that redirected link got indexed? We have recently redirected few links in the process of link reclamation and ranking dropped few days later. Every link we claimed is related to our topic (matched in content and URL) and they have good DA. Even though why it has happened? What are the general rank dropping factors in the process of link reclamation? Thanks, Satish
Intermediate & Advanced SEO | | vtmoz0 -
Competitors ranking with multiple sub-domains with no backlinks
Hi Moz, We are currently doing SEO for a hand therapy company called the Hand Therapy Group. They rank well, however, one competitor, Sydney Hand Therapy, is ranking higher than them for the term "hand therapy Sydney" (which is one of our highly focused keywords) with three different URLs (their home page, contact page and about page) despite the latter two pages have no backlinks. I understand why Google might see their homepage as being more relevant because their name is Sydney Hand Therapy (even though the Hand Therapy Group have more backlinks) but why do the other two URLs rank so well? Any help/info/advice would be brilliant! Cheers!
Intermediate & Advanced SEO | | wearehappymedia1 -
For URLs that require login, should our redirect be 301 or 302?
We have a login required section of our website that is being crawled and reporting as potential issues in Webmaster Tools. I'm not sure what the best solution to this is - is it to make URLs requiring a login noindex/nocrawl? Right now, we have them 302 redirecting to the login page, since it's a temporary redirect, it seems like it isn't the right solution. Is a 301 better?
Intermediate & Advanced SEO | | alecfwilson0 -
301 Redirect from ASP.NET to PHP...Is it possible?
Hi all, I'm trying to migrate my current website over to wordpress however my current website is ASP.NET and obviously Wordpress uses PHP. Is it possible to perform a 301 redirect from a asp.net to a php? Or do you need to convert the asp.net language into php? Or something different? I welcome your thoughts? Regards, Thomas Rochford
Intermediate & Advanced SEO | | CoGri0 -
301 redirects within same domain
If I 301 redirects all urls from http://domain.com/folder/keyword to http://domain.com/folder/keyword.htm Are new urls likely to keep most of link juicy from source url and maintain the rankings in SERP?
Intermediate & Advanced SEO | | Bull1350 -
Canonicalization interact with 301 redirects?
This is a interesting one I think. I have recently taken down some product list pages from our website www.towelsrus.co.uk. These have canonicalisation in place to deal with pages where a query string is generated depending on the search criteria. When I put a 301 redirect in place the target page redirects fine, however webmaster tools then errors with 404 on all canonicalised pages. Is this correct behaviour and how do we get over this?
Intermediate & Advanced SEO | | Towelsrus0 -
Need advice on 301 domain redirection
Hello friends, We have two sites namely spiderman-example.com & avengers-example.com which sells the same product listed out under similar categories, since we are about to stop or put down the site “avengers-example.com” because we just want to concentrate in bringing up a single brand called spiderman-example.com. “Spiderman-example” has comparatively more visitors and conversion rates than ''avengers-example'' ie. 90 % more traffic and conversion. Avengers-example has a small fraction of loyal customers who still search for the brand-name & there are a hand-full of potential keywords those ranking on its own. So is it advisable to redirect Avengers-example to spiderman-example using 301-redirect? Will this help to gain any link-juice from Avengers-example? If so how can we effectively redirect between two domain’s with minimal loss in page authority & linkjuice to enhance ''spiderman-example''? Off beat:These names "Avengers" and "Spiderman" were just used as an example but the actual site names has no relation to the ones mentioned above.
Intermediate & Advanced SEO | | semvibe0