Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

On a section of my site, I am currently using .htaccess rewrites to put the ID as part of the URL instead of in the query, like so:

RewriteRule ^([a-z_]+)?/?tours/([0-9]+)/(.*) /tours/tour_text.php?lang=$1&id=$2&urlstr=$3 [L]

For example, if someone goes to /en/tours/12/some-text-here it will rewrite it to /tours/tour_text.php?lang=en&id=12&urlstr=some-text-here. However I don't want the users to be able to put just any text, so if they type in the wrong some-text-here part it will 301 redirect them to the right page.

This works perfectly, but I can see a potential problem arising when localizing the website, so I just wanted to make sure it's not actually a problem.

How it is now, if someone goes to /en/tours/12/some-text-here, the anchor to the Spanish version of that page will be /es/tours/12/some-text-here (i.e. only changing the "en" to "es"), and then the script will then 301 them to the correct Spanish text (something like /es/tours/12/algun-texto-aqui). And the reverse will also be the same. The anchor on the Spanish version to the English version would be /en/tours/12/algun-texto-aqui and then they will be forwarded with 301 back to /en/tours/12/some-text-here. Basically, the anchor changes the language and the 301 changes the string at the end.

So I have two questions:

  • Does purposely and permanently having invalid URLs on your site that get 301'ed to the correct ones have any effect on SEO? I could make it just show the correct URL to begin with, but this is a significant amount of work due to how I am handling the translations, so I would prefer just to 301 them.
  • Will the invalid URLs that are contained in the links be added to the search engine indexes even if they get 301'ed to another page?
share|improve this question
add comment

3 Answers 3

Does purposely and permanently having invalid URLs on your site that get 301'ed to the correct ones have any effect on SEO? I could make it just show the correct URL to begin with, but this is a significant amount of work due to how I am handling the translations, so I would prefer just to 301 them.

Arguably, yes. According to Google, a 301 redirect will pass about 85-90% of PageRank, which is about the same as an ordinary link. If every link on your site 301 redirects before reaching its destination, that effect is multiplied, i.e., if we assume 15% reduction, the destination page ends up with about 13% less PageRank than it otherwise would have (85% of 85% = ~72%).

It also adds unnecessarily to the total page load time which, depending how fast your server is, may have a perceptible negative effect for users which may have indirect SEO effects (see ShopZilla case study). If it's really slow, there's a chance of direct SEO effects in Google as page speed is a (very small) part of their ranking algorithm.

A final consideration that may compound both of the above, it sounds like your example links between /es/ and /en/ will encounter 2 redirects - once to the Spanish spelling, and again to add your parameter string. If that's right, then the multiplication is greater, i.e., the destination ends up with about 24% less PageRank, slower load, etc.

Will the invalid URLs that are contained in the links be added to the search engine indexes even if they get 301'ed to another page?

No. Search engines should only index the destination of the 301 (Google example here).

share|improve this answer
add comment

You won't be able to have both your Swedish content and your English content crawled and indexed by Googlebot like that. You don't say how your are determining language. Googlebot doesn't send accept-language headers, so your redirects may not even work for Googlebot. If you are redirecting based on geographic location of the IP address, Googlebot will always get the English version.

The SEO problems with your setup are:

  • You should not use parameters for selecting language. Domain, sub-domain, and directory are the SEO approved ways of choosing language.
  • You should not automatically choose the language for users. Users need to be able to switch manually when your algorithm gets it wrong in cases like:
    • Travelling abroad and using local computers
    • International users with English browsers (very common)
    • Inaccuracies in geo-IP databases (also very common)
  • Googlebot needs to be able to crawl the site in all languages.

For more information see: How should I structure my URLs for both SEO and localization?

share|improve this answer
    
Language is determined only using the URL (using a subdirectory). I am not doing any geo-location to determine language. The root directory of the domain will be in English and other languages are sub-directories. For example, the "contact us" URL in English is /contact/ and in Spanish it's /es/contact/. However there is a part of my site where a language-specific slug is used as well, but when linking to it from other languages, it will use the wrong string for the slug. Then when the user (or bot) follows the link, they get redirected to the correct page. –  Mike Nov 5 '13 at 21:07
    
Ah, I missed that. That makes it a bit better. I would still recommend using mod_rewrite to rewrite your URLs internally rather than use external redirects, but what you are doing might work. –  Stephen Ostermiller Nov 5 '13 at 21:29
    
The redirects have to be done programatically because the slug string comes from the database and could be changed if the page title ever changes. Hard-coding all of that into an .htaccess file would be tedious to say the least. They are also internal redirects, not external. The user never leaves the domain. –  Mike Nov 5 '13 at 22:02
add comment

What you are using there (the user helpful text at the end of the URL) are know as "slugs". One good way of handling those is through the use of the "canonical" meta tag, for example on this page, the question title is in the URL, but isn't completely needed, so there is a canonical link in the source:

<link rel="canonical" 
      href="http://webmasters.stackexchange.com/questions/54799/does-purposely-linking-to-an-invalid-url-and-then-using-301-affect-seo" />

However you'll notice that there is also a 301 redirect to the full URL in place, and Google recommend this alongside the canonical link.

share|improve this answer
    
You are right regarding "[the question title in the URL, but isn't needed]", however, StackOverflow does not publish incorrect URL's inside its content, just check out this page title's anchor, it has the correct and complete URL. On @Mike's question he's telling he will not publish correct URLs inside his content, so, maybe your advice is missing that point. –  Binarysurf Nov 5 '13 at 17:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.