Welcome Guest, Not a member yet? Register   Sign In
how to route back to the root folder
#1

[eluser]brian88[/eluser]
Trying to get rid of pages that link to the same page.
how do you uri route back to the root folder?

Code:
$route['/'] = 'main/index';

this doesnt work
#2

[eluser]CroNiX[/eluser]
You can't. That's what the 'default_controller' is. For when there is no url.

How would you have "pages that link to the same page"?
#3

[eluser]brian88[/eluser]
Well google is indexing
www.mysite.com
and
www.mysite.com/main/index

Both links go to the same page. Google penalizes search ranking for duplicate content.
#4

[eluser]CroNiX[/eluser]
Google only catalogs LINKS. So, you have two different links going to the same place. Find the link going to 'main/index' and change it to just 'www.yoursite.com'. Use only one kind. Also, that's what routes do. They create alternative ways to get to the same content. But that shouldn't matter either as long as your links are only using one style. Just be consistent.
#5

[eluser]CroNiX[/eluser]
You'll also notice that
www.yoursite.com/some/url
and
www.yoursite.com/some/url/ (trailing slash)

will also be the same page. Same thing, choose one style and stick with it for all links
#6

[eluser]brian88[/eluser]
I made the change a couple weeks ago but googles still indexing that "main/index" page after I removed all those links from my site.

I guess thats the downside of not thinking about seo before launching a site. Sad
#7

[eluser]CroNiX[/eluser]
It will eventually drop off by itself (if you are SURE the link has been removed). If you have a sitemap.xml, remove that entry. You can also use googles webmaster tools to request they remove it. Yes, SEO is very important to plan up front.
#8

[eluser]CroNiX[/eluser]
You can also place those links in an htaccess (at the top, before any CI stuff) and 301 redirect them to their new location so googlebot will know the next time it crawls your site.

redirect 301 old-url new-url

Code:
redirect 301 /main/index http://www.yoursite.com/
redirect 301 /something/else http://www.yoursite.com/new-location




Theme © iAndrew 2016 - Forum software by © MyBB