Force lower case url's |
[eluser]jplanet[/eluser]
My client is interested in preventing search engines from seeing www.example.com/PRODUCTS the same as www.example.com/products. An SEO consultant strongly advised us to do this, but to do so with htaccess requires a huge performance hit. (Just for the record, I doubt that it is as important as said SEO consultant thinks it is). Ideally it should 301 redirect at all times to completely lower case urls. Any ideas how to do this with the routes config file, or some other way in CI?
[eluser]mglinski[/eluser]
replace all site_url() function calls with strtolower(site_url()) calls. alternativly, find and edit the site_url() function to "return strtolower($value);", if you know what I mean. -Matt
[eluser]jplanet[/eluser]
This sounds like a very interesting solution...does anyone know what the response will be to the http request in this case? If it is 301 redirect, that would be perfect...
[eluser]Jamie Rumbelow[/eluser]
Edit: Oops sorry, I missed a bit of your post.
[eluser]xwero[/eluser]
I wonder what the use is. For a spider to see the capitalized string you have to use it somewhere on the site. And if it's a controller or a function you will get a 404 error so you never get the same content.
[eluser]wiredesignz[/eluser]
I agree with xwero, what purpose does this serve?, If the url's are generated locally then you can force them to lowercase text, but if they are incoming you can only redirect.
[eluser]jplanet[/eluser]
To xwero and wiredesignz: Competing businesses on the web sometimes indulge in "black hat" tactics in order to cause competitors' search engine rankings to be compromised. If a website's url's can be manipulated in such a way that an altered URL can lead to a working page, someone can list that URL on another site, blog (or even forum!), which Google would index and note as duplicate content to the working url's already indexed. If you're curious about this, (hopefully to protect your sites from it and not use this knowledge for unethical purposes!), just Google canonical urls SEO, and you'll find a ton of information on it. This is a game that is usually played by very competitive, high-volume retail websites that depend almost entirely on search engine ranking for their business...
[eluser]xwero[/eluser]
And i though the internet was a peaceful place :bug: Like i said the full uppercase segment returns a 404 message so it can't link to the same content as the lowercase url. I think the same thing happens if you have routed urls. If you are afraid competitors are going to manipulate your urls to give you a bad page ranking you shouldn't enable query strings because that would be a way to pass on links with duplicate content. site.com/index.php/controller/method is than the same as site.com/index.php?c=controller&m=method. But if you do need query strings to add to some urls you could add a check to see if the url isn't routed from a full query string. Code: if(isset($_GET['c'])) |
Welcome Guest, Not a member yet? Register Sign In |