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
-
Page authority
Hello, How can my page authority be different across various page built exactly on the same model and none of them having links ? Thank you,
Moz Pro | | seoanalytics0 -
Duplicate Content for Default Document Domains
I've noticed recently that within the Moz Crawl Report I keep seeing duplicate content for one of our pages that pulls from a default document. The pages are product pages, one ending in releases/ and the other ending in releases/index and are both identical pages. Normally in these situations I would prefer to make sure that every link is being sent to the releases/ page, however according to Moz, the releases/index page is actually ranking better and has a higher internal link count. Can someone advise me on the best way to deal with this situation? Hopefully I've explained myself well enough! Thanks Sam
Moz Pro | | BlueLinkERP0 -
ERROR: Too Many on-page links!
User wise, my product menu @LEDSupply.com is user friendly, but I'm concerned that it might be seen by crawlers as bad because of the TOO MANY ON-PAGE LINKS error I am getting in my moz crawl report. Is it really counting all the links in every drop-down menu? If so, is there are resource on how to fix it????
Moz Pro | | saultienut0 -
Third crawl of my sites back to 250 pages
Hi all, I've been waiting some days for the third crawl of my sites, but SEOMOZ only crawled 277 pages. The next phrase appeared on my crawl report: Pages Crawled: 277 | Limit: 250 My last 2 crawls were of about 10K limit. Any idea? Kind regards, Simon.
Moz Pro | | Aureka0 -
Too many on-page links
one of my SEOmoz pro campaigns has given me the warning: Too many on-page links and the page in question is my html sitemap. How do i resolve this because I obviously need my sitemap. How do i get around this?
Moz Pro | | CompleteOffice1 -
Help with duplicate title tags?
I was looking in Google webmaster tools and it says I have 95 duplicate title tags for my site Noah's Dad. When I look through the list it appears the pages with duplicate title tags are some of my category pages, archive pages, and some author pages... Not sure if you guys can use some of the tools to see what is actually showing up duplicate or not, and if you need more info just let me know. But I wanted to see if this is something I should be concerned with? Should WMT also say 0 in duplicate content? It seems like when I started my blog I was told no to be conceded with this sort of stuff in gwmt. Anyways...I just wanted to see what you guys think. (By the way, is there any way to tell what this duplicate content is having (or has had) on my SERP results? Thanks.
Moz Pro | | NoahsDad0 -
Pass Page LinkJuice? Or Pass Keyword LinkJuice?
I have a popular page that is not one of the three pages that I am hoping to raise awareness of (want to focus on). The dilemma I am trying to understand is that I really don't want to encourage all the flow from the popular to ONE of my hopeful pages (focus pages). Rather, I want to focus the keyword portions of that page to help the three hopeful pages. So I consider the rel=canonical tag.... err no. rel=canonical would pass ALL my popular page link juice to ONE of my three hopeful pages. What's the best way to pass the keyword link juice relevant to each of my three hopeful pages their, um, portion, of the popular page link juice. I'm white hat by preference. All four pages are good legitimate landing pages, and of course I dread sabotaging the popularity of what is working. Suggestions? Advice?
Moz Pro | | iansears0 -
What do i do when all pages are grade A?
I've used the on page grade and now have all my pages at a grade A for relevant keywords. Most of them are cool, achieveing first page rankings apart from a few massive keywords. So the question is, what's next? What do i do now that I'm at grade A, but perhaps not #1 yet... Cheers -dan
Moz Pro | | spytunes0