Yii Framework Forum: Friendly Url Not Working - Yii Framework Forum

Jump to content

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

Friendly Url Not Working Rate Topic: -----

#1 User is offline   rpaulpen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 136
  • Joined: 01-December 08

Posted 10 August 2010 - 04:24 PM

Hi All,

I'm having a problem with the friendly url feature where it is not working.

I want to enter "http://mysite.com/ep" and have it route to "http://mysite.com/employees/profile"

My config is as follows:

'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array('ep'=>'employees/profile'),
),

my .htaccess also has :

RewriteEngine On
IndexIgnore */*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]


Any help would be greatly appreciated.

R
0

#2 User is offline   dimilow 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 16-March 09

Posted 10 August 2010 - 09:06 PM

try it with the default scaffold application and see if it is working first
tipstank.com - where I share my coding stuff
0

#3 User is offline   rpaulpen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 136
  • Joined: 01-December 08

Posted 11 August 2010 - 09:17 AM

Figured it out. Didn't have the correct order for the rules. It's not as obvious when reading the documentation and maybe some further examples would be helpful for others.

Thanks

R
0

#4 User is offline   omko 

  • Advanced Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 75
  • Joined: 13-July 10
  • Location:Київ - мать городов русских.

Posted 11 August 2010 - 09:26 AM

'urlManager'=>array(
			'urlFormat'=>'path',
			'urlSuffix'=>'.html',
			'showScriptName' => false,
			'rules'=>array(
				'page/<view>'=>array('site/page'),
				'index'=>array('site/index'),
				'contact'=>array('site/contact'),
				'login'=>array('user/login'),
				'logout'=>array('user/logout'),
				'registration'=>array('user/registration'),
				'recovery'=>array('user/recovery'),


Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

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