Yii Framework Forum: Url Issue - Yii Framework Forum

Jump to content

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

Url Issue Rate Topic: -----

#1 User is offline   johan02 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 03-December 12

Posted 13 December 2012 - 11:09 AM

Hello friends .
how could i remove page(word) from the url .
i mean www.example/chain/walmart/page/2. i want to remove page (word) from url and url should be www.example/chain/walmart/2


in urlManager i have this rule :

'chain/<slug:[\d\w-åäöÅÄÖéÉ]+>/*' => 'chain/view'

any solution ?
0

#2 User is offline   redguy 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 788
  • Joined: 02-July 10
  • Location:Central Poland

Posted 13 December 2012 - 01:10 PM

add second rule:
'chain/<slug:[\d\w-åäöÅÄÖéÉ]+>/<page:\d+>' => 'chain/view',
'chain/<slug:[\d\w-åäöÅÄÖéÉ]+>' => 'chain/view',

order matters - first matching rule wins.
red
0

#3 User is offline   johan02 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 03-December 12

Posted 14 December 2012 - 04:23 AM

View Postredguy, on 13 December 2012 - 01:10 PM, said:

add second rule:
'chain/<slug:[\d\w-åäöÅÄÖéÉ]+>/<page:\d+>' => 'chain/view',
'chain/<slug:[\d\w-åäöÅÄÖéÉ]+>' => 'chain/view',

order matters - first matching rule wins.

Thnx redGuy.
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