![]() |
Code igniter and SEO - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Code igniter and SEO (/showthread.php?tid=55337) |
Code igniter and SEO - El Forum - 10-22-2012 [eluser]Kobus M[/eluser] Hi guys, I have found the following problems in my SEO reports, and this is partially due to how I developed my CMS and site. /index.php and /index.php/site_content/view/home both opens the homepage. The SEO report says that I have the same metadata for these two pages, which is indeed correct, but it is actually the same page. The quickest solution is probably to remove any reference to index.php/site_content/view/home and use the base_url() wherever I refer to the homepage. I am not opposed to doing this, but I was wondering if this could be done via routes somehow? Code: $routes[''] = 'site_content/view/home'; I am trying to find out what I should put in the single quotes above to reference the base URL address? Is there a way? Thanks! Kobus Code igniter and SEO - El Forum - 10-22-2012 [eluser]Mr. Pickle[/eluser] I would just put the following code in /site_content/view/home in the <head> section: Code: <link href="http://www.yoursite.com/index.php" rel="canonical" /> Then you tell search-engines that /site_content/view/home should be treated as if it was /index.php Of course your system has to allow you to put this there. If this is the only page where it happens you can put it as a static if/else in your code, if not it's a nice addition for your system to make this feature ![]() Code igniter and SEO - El Forum - 10-22-2012 [eluser]Kobus M[/eluser] [quote author="Mr. Pickle" date="1350911188"]I would just put the following code in /site_content/view/home in the <head> section: Code: <link href="http://www.yoursite.com/index.php" rel="canonical" /> Then you tell search-engines that /site_content/view/home should be treated as if it was /index.php Of course your system has to allow you to put this there. If this is the only page where it happens you can put it as a static if/else in your code, if not it's a nice addition for your system to make this feature ![]() Thanks, Mr. Pickle. That was a very good idea. I have implemented this in my CMS. I have also done what I initially thought of doing, by removing all references to the /view/home and simply using /. Have a great day! |