Codeigniter - Controller and duplicate pages
-
Hi there,
I use Codeigniter as framework and I have a question about the duplicate page.
Actually, for default, the typical page in a CodeIgniter framework is something like this:
http://www.domain.com/site/contact
where site is the controller containing the contact function that point to the contact.html view...
To have a better URL I use a trick with the "routes" that redirect any http://www.domain.com/contact to the original http://www.domain.com/site/contact
Of course the both are valid and the both are... crawled! So I get the duplicate page.
Is this something I have to manage, maybe with .htaccess?
Any idea would be very appreciated.
Thanks for you precious time guys!
Shella
-
I'm not familiar with CodeIgniter, but this isn't terribly different from how Wordpress and other PHP-based CMSs manage permalinks.
Currently you're simply forwarding shortened URLs (/contact/) to the actual URL (/site/contact/), which isn't ideal. It would be preferable to remove the base path (/site/) from the URL completely.
This guide (http://www.web-and-development.com/codeigniter-remove-index-php-minimize-url/) has a good rundown on how to control this in .htaccess. I believe that the sections titled "Removing 1st URL segment" and "Routing automatically" are going to be the ones that are applicable to your case, because you're trying to change the controller.
You should also take a look through the original documentation at http://ellislab.com/codeigniter/user-guide/general/urls.html.
You're also going to want to make sure that any canonicals being used in the match the intended URL, and that any incorrect URLs (eg /site/contact/) are 301 redirecting to the proper URL (eg /contact/). Use wheregoes.com and type in the /site/contact/ version of the URL to test this - it should spit out "301 redirect" not "302" or anything else.
If you're not really comfortable messing around with htaccess, I'd highly recommend trying this out on a development server and making sure it all works correctly before you move it to a live server.
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
-
Filter Pages
Howdy Moz Forum!! I have a headache of a job over here in the UK and I'd welcome any advice! - It's sunny today, only 1 of 5 days in a year and i'm stuck on this! I have a client that currently has 22,000 pages indexed to Google with almost 4000 showing as duplicate content. The site has a "jobs" and "candidates" list. This can cause all sorts of variations such as job title, language, location etc. The filter pages all seem to be indexed. Plus the static pages are indexed. For example if there were 100 jobs at Moz being advertised, it is displaying the jobs on the following URL structure - /moz
Moz Pro | | Slumberjac
/moz/moz-jobs
/moz/moz-jobs/page/2
/moz/moz-jobs/page/3
/moz/moz-jobs/page/4
/moz/moz-jobs/page/5 ETC ETC Imagine this with some going up to page/250 I have checked GA data and can see that although there are tons of pages indexed this way, non of them past the "/moz/moz-jobs" URL get any sort of organic traffic. So, my first question! - Should I use rel-canonical tags on all the /page/2 & /page/3 etc results and point them all at the /moz/moz-jobs parent page?? The reason for this is these pages have the same title and content and fall very close to "duplicate" content even though it does pull in different jobs... I hope i'm making sense? There is also a lot of pages indexed in a way such as- https://www.examplesite.co.uk/moz-jobs/search/page/9/?candidate_search_type=seo-consulant&candidate_search_language=blank-language These are filter pages... and as far as I'm concerned shouldn't really be indexed? Second question! - Should I "no follow" everything after /page in this instance? To keep things tidy? I don't want all the variations indexed! Any help or general thoughts would be much appreciated! Thanks.0 -
301 Redirects - But still duplicate content?
Our website domain website.com redirects to website.com/en (since it's in English). Therefore, all pages on website.com redirects to website.com/en. In my Moz analytics, it says I have duplicate content, and lists all of these pages. Didn't the 301 redirects take care of the duplicate content? Or do I still have to add canonical tags?
Moz Pro | | Taulia0 -
SERP control panel issues
Hi I use the SERP control panel every day, but now it hardly works and only shows info for the companies who have Google Places and show in the local results. I use Google Chrome on my (old) Toshiba laptop. Are there any technical issues with the SERP control panel at the moment? Kind regards, Barnaby
Moz Pro | | FreeRangeUK1 -
Crawl Diagnostics 403 on home page...
In the crawl diagnostics it says oursite.com/ has a 403. doesn't say what's causing it but mentions no robots.txt. There is a robots.txt and I see no problems. How can I find out more information about this error?
Moz Pro | | martJ0 -
Is it possible to submit a page to the seomoz index?
We recently got added to dmoz and botw and would like to see those links considered in our domain authority as we are tracking our progress and comparing ourselves to other sites. Is it possible to submit links to the seomoz index manually to have those tracked? (If I am even understanding this correctly)
Moz Pro | | hyperthalamus0 -
Duplicate Page Titles and Content
The SeoMoz crawler has found many pages like this on my site with /?Letter=Letter, e.g. http://www.johnsearles.com/metal-art-tiles/?D=A. I believe it is finding multiple caches of a page and identifying them as duplicates. Is there any way to screen out these multiple cache results?
Moz Pro | | johnsearles0 -
Duplicate page title
I own a store www.mzube.co.uk and the scam always says that I have duplicate page titles or duplicate page. What happens is thn I may have for example www.mzube.co.uk/allproducts/page1. And if I hve 20 pages all what will change from each page is the number at the end and all the rest of the page name will be the same but really the pages are if different products. So the scans think I have 20 pages the same but I havent Is this a concern as I don't think I can avoid this Hope you can answer
Moz Pro | | mzube0 -
Only Crawling 1 page?
Hi Guys, Any advice much appreciated on this! Recently set up a new campaign on my dashboard with just 5 keywords. The domain is brammer.co.uk and a quick Google site:brammer.co.uk shows a good amount of indexed pages. However - first seomoz tool crawl has only crawled 1 url!! "Last Crawl Completed: Apr. 12th, 2011 Next Crawl Starts: Apr. 17th, 2011" Any ideas what's stopping the tool crawl anymore of the site?? Cheers in advance.. J
Moz Pro | | lovealbatross0