Yii Framework Forum: Urlmanager Breaks The Website? - Yii Framework Forum

Jump to content

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

Urlmanager Breaks The Website? Rate Topic: ***** 1 Votes

#1 User is offline   dty 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 30-December 10
  • Location:Mount Laurel, New Jersey

Posted 04 April 2013 - 11:03 PM

For some reason, since I've enabled the urlManager, not I can't see to get /site/logout/ or /logout/ to work.

Do I need more coffee or is there something awry here? Here's all pertinent info:

.htaccess (maybe it might apply? i doubt it)
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



main.cfg
// application components
	'components'=>array(
		'assetManager' => array(
 			'linkAssets' => true,
   	),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		'request'=>array(
			'baseUrl' => "http://google.com"
		),
		
		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName'=>false,
			'rules'=>array(
				'<action:(login|logout|about)>' => 'site/<action>',
				'gii'=>'gii',
				'gii/<controller:nw+>'=>'gii/<controller>',
				'gii/<controller:nw+>/<action:nw+>'=>'gii/<controller>/<action>',
				'<controller:nw+>/<action:nw+>'=>'<controller>/<action>',
			),
		),



Pardon the weird formatting from c/p from Coda. Not sure why it did that.

My apologies if its something obvious :/

This post has been edited by dty: 04 April 2013 - 11:05 PM

0

#2 User is offline   dty 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 30-December 10
  • Location:Mount Laurel, New Jersey

  Posted 07 April 2013 - 08:01 AM

Still having issues with no answer.

When I do this, my index.php goes away so I am assuming my .htaccess is all well and good.

However, none of my routes work.

domain.com/site/contact : loads index
domain.com/site/login : loads index
domain.com/site/logout : loads index
domain.com/users/create : loads index

the SiteController and the UsersController all have these actions, and I fail to see the problem. Live Yii chat last night also could not find the problem.

Is there any other code I can share to help solve this? I've gotten this to work on other yii-created sites. Could it be a permission problem?

Please, help! Anyone! www.domain.com/index.php/r=site/login looks completely awful.
0

#3 User is offline   dty 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 30-December 10
  • Location:Mount Laurel, New Jersey

Posted 07 April 2013 - 11:06 AM

Not sure I changed anything, but now the only thing not working is that index.php is not being removed from the URL.

Here is my current .htaccess

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]


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