Reputation: 1812
I am creating a CodeIgniter site. I have an SEO problem to address. The following URLs all point to the same page, although search engines see them all as different urls:
www.yahoo.com
http://www.yahoo.com
http://www.yahoo.com/
Does CodeIgniter have a function that can automatically redirect pages to a single URL? if not, has anyone written a function that can create a unifying URL for the redirect?
Currently I am redirecting all pages to:
"http://-----.com/" . uri_string();
Upvotes: 0
Views: 129
Reputation: 219834
Use canonical URLs. Basically you tell the search engines that when they pull up that page by any of those URLs that the one you specify as the canonical URL is the one to be considered the "main" URL and shown in their index. The others are then not considered duplicates.
<link rel="canonical" href="http://www.yahoo.com/" />
Upvotes: 1