CodeIgniter Forums
Remove index.php is not SEO friendly - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Remove index.php is not SEO friendly (/thread-52844.html)



Remove index.php is not SEO friendly - El Forum - 06-28-2012

[eluser]fjamal[/eluser]
Writing htaccess that allows me to remove index.php from the URL can confuse search engines because i will have many links that leads to the same page e.g.

http://www.domain.com/index.php/welcome/index
http://www.domain.com/index.php/welcome/
http://www.domain.com/welcome/index
http://www.domain.com/welcome/

As you see, when it comes to SEO, this could be a problem. What can i do to solve this problem?

My .htaccess include the following commands:

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /ci_sample/index.php/$1 [L]





Remove index.php is not SEO friendly - El Forum - 06-29-2012

[eluser]Jason Hamilton-Mascioli[/eluser]
In your robots text file disallow :

Code:
http://www.domain.com/index.php/welcome/index
http://www.domain.com/index.php/welcome/
http://www.domain.com/welcome/index



Remove index.php is not SEO friendly - El Forum - 06-29-2012

[eluser]CroNiX[/eluser]
It doesn't matter if it works with "index.php" in the url. The point is, you don't use those links that have "index.php" in them on any pages and so they don't get cataloged by search engines. Search engines don't know about pages unless there is a link to that page. Do you think google just makes up urls to test to see if they go somewhere? No, they only follow links.

So, just use the CI url helpers to generate all of your urls and there won't be a problem as they won't ever put "index.php" in the url unless you don't have CI set up correctly when removing index.php from the url.


Remove index.php is not SEO friendly - El Forum - 06-29-2012

[eluser]vincej[/eluser]
In building my pages I have placed the title of each page into the controller and I upload it to the view dynamically. Each view is a pure php page ie no html header content at all. Is this bad seo ? If so should I go through all of my pages and add back in the html title ?


Remove index.php is not SEO friendly - El Forum - 06-29-2012

[eluser]Jason Hamilton-Mascioli[/eluser]
No difference. The output is the same. Search engines cannot see the source code only the output.


Remove index.php is not SEO friendly - El Forum - 06-29-2012

[eluser]Rolly1971[/eluser]
CroNiX hit the nail on the head. not much more i can say other than if you have used htaccess to remove index.php why are you putting links out that use index.php????? with the htaccess you are setup to not use index.php and there fore have more SEO friendly url's so do not use index.php in the url's you pass out to your site. simple as that really.


Remove index.php is not SEO friendly - El Forum - 06-29-2012

[eluser]vincej[/eluser]
CroxNix:
Quote:So, just use the CI url helpers to generate all of your urls and there won’t be a problem as they won’t ever put “index.php” in the url unless you don’t have CI set up correctly when removing index.php from the url.
Ummm, I use anchor() all the the time and they all have index in the url .... I guess this means I don't have CI set up properly ...

Can someone elaborate and advise me as to what I should have done at set up and didn't ..

Many thanks


Remove index.php is not SEO friendly - El Forum - 06-29-2012

[eluser]CroNiX[/eluser]
/application/config/config.php
Code:
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';



Remove index.php is not SEO friendly - El Forum - 08-01-2012

[eluser]fjamal[/eluser]
Good answers.

Will get back to it later, i got caught with other tasks...