Yii Framework Forum: Url Manager Question - Yii Framework Forum

Jump to content

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

Url Manager Question Rate Topic: -----

#1 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 25 October 2010 - 06:26 AM

Hi folks.

I set my app to use urls like paths.

On my config file
 
		'components'=>array(
			'urlManager'=>array(
				'urlFormat'=>'path',
				'showScriptName'=>false,
				'rules'=>array(
					'/'=>'site/index',
					'<controller:\w+>/<id:\d+>'=>'<controller>/view',
					'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>/<id>',
					'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
				),
			),
		),


The problem is that links still appears http://www.othys.com...ge?view=clients like get
if I try change the url to http://www.othys.com...ge/view/clients the 404 error shows the message "The requested view "*" was not found."

How can I solve this?
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 25 October 2010 - 08:43 AM

The parameter name and regular expression must match your URL parameters. So try changing <id:\d+> to e.g. <view:\w+> or only <view>.
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