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
-
Duplicate content issue
I'm getting duplicate content warnings from Moz for various slideshows on my posts and pages in Wordpress. It seems when I create a slideshow it exists as its own page and as these have no text Moz sees them as duplicates. Here are some examples - http://www.weddingphotojournalist.co.uk/?gallery_page=slideshow&pp_gallery_id=1331991312
Moz Pro | | simonatkinsphoto
Moz says is a duplicate of -
http://www.weddingphotojournalist.co.uk/?gallery_page=slideshow&pp_gallery_id=1000144730 The second of those two slideshows is on this page -http://www.weddingphotojournalist.co.uk/menorca-wedding/ but also exists as the page above. How can i avoid these being seen as duplicate content?0 -
Duplicated content generated by keywords
Hello! I am kind of new to SEO and MOZ, so I really need your help to understand why some of my keywords generate duplicated content. Meaning, in my blog posts I use various SEO keywords. It shows up that in my MOZ crawl analysis, I have these keywords listed as duplicates: so two/three different keywords are pointing to the same articles and are considered duplicates? I really don't understand how it is possible. Did it also happen to you? I highly appreciate it. Thank you
Moz Pro | | DianaC0 -
On-page grader question
Hi there, Getting to know the Pro tools and can't find an answer to this. Can someone explain for me please? Using on page grader, I found a couple pages with an F. I scrolled downWTO where it shows the keyword phrases and under each, the URL. Clicking on the first keyword "Building site alarms"it tells me off essentially for not optimising the page for that term. The URL is "construction site security systems" which are different to building site alarms which also have their own page. I don't understand why is Moz associating this keyword with this page? I certainly haven't told it to. Please he
Moz Pro | | DaddySmurf0 -
Blog Page URLs Showing Duplicate Content
On the SEOMoz Crawl Diagnostics, we are receiving information that we have duplicate page content for the URL Blog pages. For Example: blog/page/33/ blog/page/34/ blog/page/35/ blog/page/36/ These are older post in our blog. Moz is saying that these are duplicate content. What is the best way to fix the URL structure of the pages?
Moz Pro | | _Thriveworks0 -
What is more important, page authority or linking root domains?
I have 2 pages in my report that are identical: www.ferringway.com (more page authority......21 vs. 1) www.ferringway.com/index.php (more linking root domains...... 40 vs. 21) Which one should I delete or should I do something like a 301 redirect? Your help is greatly appreciated! Sheryl
Moz Pro | | TOMMarketingLtd.0 -
Is it possible to exclude pages from Crawl Diagnostic?
I like the crawl diagnostic but it shows many errors due to a forum that I have. I don't care about the SEO value of this forum and would like to exclude any pages in the /forum/ directory. Is it possible to add exclusions to the crawl diagnostic tool?
Moz Pro | | wfernley2 -
On page optimisation tool issues
When viewing my campaign and looking at the on page optimisation tool, I have a few issues. I seems to only shows the keywords I want rankings for and how optimised my homepage is for those keywords. Is there any way I can get it to analyse permanently specifc keywords for specific pages because my homepage isnt optimised for some keywords which are on my list, which I have optimised other pages for, and because its looking at my homepage its getting a really low grade, and looks really bad and frustrates me because I cant work this out. Any help greatly appreciated.
Moz Pro | | CompleteOffice1 -
What the . . ! Duplicate Pages and Titles WAY up?
My duplicate pages went up 50 plus in the past week, and my duplicate page titles went over more then 100. We recently redesigned the website, but it has been up for several weeks now. The only change I made specifically last week or late the week before was to get my 301 redirects done to get the www. version and the non www version pointing to the same place (as well as a couple other sites that point to it). I'm sure this is not enough info to figure out what went wrong . . . I'd love some help in figuring this out though.
Moz Pro | | damon12120