The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Moz Tools
    4. Codeigniter - Controller and duplicate pages

    Codeigniter - Controller and duplicate pages

    Moz Tools
    2 2 1.9k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CarloShellaMascella
      CarloShellaMascella last edited by

      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

      1 Reply Last reply Reply Quote 0
      • KaneJamison
        KaneJamison last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        • Duplicate Content on a page that isn't duplicate?
          Vanderlindemedia
          Vanderlindemedia
          0
          6
          52

        • Duplicate pages coming from links from the login page - what should we do about them?
          Carson-Ward
          Carson-Ward
          0
          5
          297

        • Moz is treating my pages as duplicate content but the pages have different content in reality
          clestcruz
          clestcruz
          0
          3
          168

        • Duplicate Pages
          ofw12387
          ofw12387
          0
          3
          93

        • Roger found Duplicate Page Content, but all my pages are canonicalized
          Dr-Pete
          Dr-Pete
          0
          7
          367

        • I have another Duplicate page content Question to ask.Why does my blog tags come up as duplicates when my page gets crawled,how do I fix it?
          PCTechGuy2012
          PCTechGuy2012
          0
          4
          515

        • To many warnings on duplicate pages or on-page links( -ve ranking i think)
          Orrouk
          Orrouk
          0
          14
          1.8k

        • "Issue: Duplicate Page Content " in Crawl Diagnostics - but these pages are noindex
          AaronWheeler
          AaronWheeler
          0
          2
          1.1k

        Get started with Moz Pro!

        Unlock the power of advanced SEO tools and data-driven insights.

        Start my free trial
        Products
        • Moz Pro
        • Moz Local
        • Moz API
        • Moz Data
        • STAT
        • Product Updates
        Moz Solutions
        • SMB Solutions
        • Agency Solutions
        • Enterprise Solutions
        • Digital Marketers
        Free SEO Tools
        • Domain Authority Checker
        • Link Explorer
        • Keyword Explorer
        • Competitive Research
        • Brand Authority Checker
        • Local Citation Checker
        • MozBar Extension
        • MozCast
        Resources
        • Blog
        • SEO Learning Center
        • Help Hub
        • Beginner's Guide to SEO
        • How-to Guides
        • Moz Academy
        • API Docs
        About Moz
        • About
        • Team
        • Careers
        • Contact
        Why Moz
        • Case Studies
        • Testimonials
        Get Involved
        • Become an Affiliate
        • MozCon
        • Webinars
        • Practical Marketer Series
        • MozPod
        Connect with us

        Contact the Help team

        Join our newsletter
        Moz logo
        © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
        • Accessibility
        • Terms of Use
        • Privacy