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
-
I am having a duplicate title -pagination issue Need Help
In WordPress I added %%page%% saved changes and ran a test in Moz and screaming frog, it doesn't show any duplicates. But when I open the site up in a new browser the duplicate titles are still there. No access to the PHP file due to the theme the client chose also. Any suggestions anyone?
Moz Pro | | Strateguyz0 -
Competitor Ranks Highly Despite LOTS of Duplication
One of my Moz campaigns tracks my main competitor. I can't get over the fact that this competitor continues to rank well despite having thousands of duplication issues while I currently have less than 10. Our websites are similar both structurally and product-wise. The two images attached include OSE comparisons for the keyword "kraft envelopes". My competitor ranks #2 for the term, while I rank #9. I don't get why! And again, looking from a top-level perspective, MOZ shows that my competitor's website is full of duplication issues and other problems while my site is healthy as a horse. All responses are greatly appreciated. QmSlfET.jpg 9CDny60.jpg
Moz Pro | | jampaper0 -
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 -
Crawl Diagnostics - Crawling way more pages than my site has?
Hello all, I'm fairly new here, more of a paid search guy dabbling in SEO on the side. I have a client that I have in SEOMoz and the Crawl Diagnostics report is showing 10,000+ pages crawled and I think the site has at most 800 pages (e-commerce site using freewebstore.org as the platform). Any reasons this would be happening?
Moz Pro | | LodestoneGen0 -
On Page Grading Not Working
I am not getting any results in on page grading. When I click on add keywords a list of keywords appears that I have previously entered. They have tick boxes next to them and you can filter them but SEO moz is not automtically creating grade reports? Any ideas? Obviously I've set it up wrong somehow.
Moz Pro | | SamCUK0 -
How to Optimize a Home Page?
Can anyone advise on what is the best way to optimise the home page? Many websites I see include the target(focus) keywords from other pages on the home page. Is this self competition? "Avoid Keyword Self-Cannibalization- It's a best practice in SEO to target each keyword with a single page on your site" If an e-commerce website has 4 levels in the SEO architecture. Home Page, Brand Pages(Category), Range pages(sub-category) and individual product pages. It would seem that the main keywords would be within the category(brands) level of a website. However many websites I see include these on the home page as well. Could someone please clarify this? I do not recall seeing the report card saying Self-Cannibalization when these keywords(category level) are listed on the home page. However I could be wrong, Please could someone advise on what SEO MOZs recommendations are for best practise on optimizing a home page so that it does not compete with category pages, or other pages on the website. Thanks
Moz Pro | | WMA0 -
Too Many On-Page Links: Crawl Diag vs On-Page
I've got a site I'm optimizing that has thousands of 'too many links on-page' warnings from the SeoMoz crawl diagnostic. I've been in there and realized that there are indeed, the rent is too damned high, and it's due to a header/left/footer category menu that's repeating itself. So I changed these links to NoFollow, cutting my total links by about 50 per page. I was too impatient to wait for a new crawl, so I used the On Page Reports to see if anything would come up on the Internal Link Count/External Link Count factors, and nothing did. However, the crawl (eventually) came back with the same warning. I looked at the link Count in the crawl details, and realized that it's basically counting every single '<a href'="" on="" the="" page.="" because="" of="" this,="" i="" guess="" my="" questions="" are="" twofold:<="" p=""></a> <a href'="" on="" the="" page.="" because="" of="" this,="" i="" guess="" my="" questions="" are="" twofold:<="" p="">1. Is no-follow a valid strategy to reduce link count for a page? (Obviously not for SeoMoz crawler, but for Google)</a> <a href'="" on="" the="" page.="" because="" of="" this,="" i="" guess="" my="" questions="" are="" twofold:<="" p="">2. What metric does the On-Page Report use to determine if there are too many Internal/External links? Apologies if this has been asked, the search didn't seem to come up with anything specific to this.</a>
Moz Pro | | icecarats0 -
Seomoz & Duplicate Page Content Issue?
Hi, What is the criteria on Seomoz Crawl Diagnostic Report? I got a long list of URLs indicating Content that is identical (or nearly identical) to content on other pages of your site forces your pages to unnecessarily compete with each other for rankings. But as I gone through none of the reported pages duplicate. What should I do? Thanks in Advance
Moz Pro | | VipinLouka780