Yii Framework Forum: url redirections - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

url redirections Rate Topic: -----

#1 User is offline   augustin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 07-April 10

Posted 04 May 2010 - 02:30 PM

I've got now quite pretty urls in form
"example.com/cities" or
"example.com/city/madrid"
and this is good.

But if I go to
"example.com/index.php?r=city/index" or
"exapmle.com/index.php?r=city/view&name=madrid"
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?

regards,
Augustin
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,358
  • Joined: 12-October 09
  • Location:Croatia

Posted 04 May 2010 - 02:48 PM

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...
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   augustin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 07-April 10

Posted 04 May 2010 - 02:55 PM

View Postmdomba, on 04 May 2010 - 02:48 PM, said:

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.
0

#4 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,358
  • Joined: 12-October 09
  • Location:Croatia

Posted 04 May 2010 - 03:08 PM

As for google... I don't see that as a problem...
take a look here http://www.google.co...en&answer=66359
and here http://www.google.co...y?answer=139066
Find more about me.... btw. Do you know your WAN IP?
0

#5 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 04 May 2010 - 03:21 PM

Enable strict parsing in config.
0

#6 User is offline   augustin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 07-April 10

Posted 04 May 2010 - 04:05 PM

View PostY!!, on 04 May 2010 - 03:21 PM, said:

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?
0

#7 User is offline   zitter 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 140
  • Joined: 14-July 09

Posted 04 May 2010 - 04:05 PM

@augustin: to hide index.php look at "hiding index.php" section in http://www.yiiframew...uide/topics.url
0

#8 User is offline   augustin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 07-April 10

Posted 04 May 2010 - 04:22 PM

View Postzitter, on 04 May 2010 - 04:05 PM, said:

@augustin: to hide index.php look at "hiding index.php" section in http://www.yiiframew...uide/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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users