url redirections

I’ve got now quite pretty urls in form

"example.com/cities" or


and this is good.

But if I go to

"example.com/index.php?r=city/index" or


I get the same pages too. And that’s not so good (duplicate content in google). What is the best way to resolve this issue?



I don’t see a problem…

if you don’t have anywhere a link to ex. example.com/index.php?r=city/index, then how would google even find that out…

i conducted a small experiment – i had a website with no incoming links at all (0 incoming links), and i visited it few times with browser with google toolbar… it was sufficient to get it indexed.

i don’t think so, that someone will visit directly “example.com/index.php?r=city/index” but “example.com/index.php” is quite possible (eg. someone is just curious if this great site is made with php)).

what is the best way to hide "index.php" from user? naive use of .htaccess could lead to 301 rediraction circle.

As for google… I don’t see that as a problem…

take a look here http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=66359

and here http://www.google.com/support/webmasters/bin/answer.py?answer=139066

Enable strict parsing in config.

that was what i was looking for. thank you amigo!

and what to do to "example.com/index.php" give back 404 or 301-redirect to example.com?

@augustin: to hide index.php look at "hiding index.php" section in http://www.yiiframework.com/doc/guide/topics.url

i made it already – urlmanager generates url without index.php, but still if i write "example.com/index.php" i get my homepage. one should rather change something in .htaccess and most probaly also somewhere else.