CodeIgniter Forums
Pages are getting indexed multiple times - 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: Pages are getting indexed multiple times (/showthread.php?tid=36736)



Pages are getting indexed multiple times - El Forum - 12-13-2010

[eluser]Unknown[/eluser]
Sorry if this is in the wrong place, but I've come across a problem. I hope to build a cms system myself on the CI framework, but for now, I'm making static pages.

I'm using views to make a generic header and footer and then a page for the content. Then putting these three in a controller.

Now on google, if I search my domain I get the following results:

mydomain.com/index.php
mydomain.com/contact.php
mydomain.com/contact
mydomain.com/

I don't want two versions of the same page to show up, but the biggest problem is that when you go to mydomain.com/contact.php it goes to 404

What do you think my best option is. Would forcing a suffix of php on each page solve the problem?

Thanks in advance.


Pages are getting indexed multiple times - El Forum - 12-13-2010

[eluser]mdvaldosta[/eluser]
You should use .htaccess to 301 redirect mydomain.com, mydomain.com/index.php, www.mydomain.com, www.mydomain.com/index.php all to mydomain.com/ (or www.mydomain.com/, whichever you prefer). As for the contact page, again you want to use whichever extension you've chosen and 301 redirect others to that one.


Pages are getting indexed multiple times - El Forum - 12-13-2010

[eluser]Unknown[/eluser]
That makes a lot of sense. Thank you for your help, I'll try it out now Smile