Welcome Guest, Not a member yet? Register   Sign In
Remove index.php is not SEO friendly
#1

[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]


#2

[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
#3

[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.
#4

[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 ?
#5

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

[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.
#7

[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
#8

[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'] = '';
#9

[eluser]fjamal[/eluser]
Good answers.

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




Theme © iAndrew 2016 - Forum software by © MyBB