Yii Framework Forum: Url Rewriting - Yii Framework Forum

Jump to content

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

Url Rewriting Show only domain name in url Rate Topic: -----

#1 User is offline   Shridhar Somani 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 19-January 10

Posted 19 January 2010 - 05:55 AM

Hi All,

I am new to YII Framework and i want to show only domain name in URL not the whole URL with controller name and action name.

Currently i am getting the url in following format:-
http://www.testdomain.com/application name/controller name/action name

but i want to show it like this only:-
http://www.testdomain.com/application name/
or
http://www.testdomain.com/


Controller name and Action name should not be display.

Can any one help me on this?

Thanks!!!
0

#2 User is offline   notzippy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 06-October 08

Posted 19 January 2010 - 10:18 AM

You are talking about the urlManager see
http://www.yiiframew...uide/topics.url
nz
0

#3 User is offline   Shridhar Somani 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 19-January 10

Posted 20 January 2010 - 12:39 AM

Yes, I am talking about UrlManager.

I am using it that's why i am getting the URL in the format like http://www.testdomai...name/actionname instead of getting http://www.testdomai...name/actionname in this format.

I am able to modify and hiding index.php from URL but i just want to show url in the following format:-
http://www.testdomai...applicationname
or
http://www.testdomain.com

I know that it's something related to .htaccess file but i am not getting the right solution for this.

Please help me on this.

Thanks!!!
0

#4 User is offline   Shridhar Somani 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 19-January 10

Posted 20 January 2010 - 12:42 AM

Yes, I am talking about UrlManager.

I am using it that's why i am getting the URL in the format like http://www.testdomain.com/application name/controllerId/actionId instead of getting http://www.testdomain.com/application name/index.php?r=controllerId/actionId in this format.

I am able to modify and hiding index.php from URL but i just want to show url in the following format:-
http://www.testdomain.com/application name
or
http://www.testdomain.com

I know that it's something related to .htaccess file but i am not getting the right solution for this.

Please help me on this.

Thanks!!!
0

#5 User is offline   Minase Taki 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 19-January 10

Posted 20 January 2010 - 07:34 AM

not sure but the only solution that i see here is using frames
1

#6 User is offline   Mike 

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

Posted 20 January 2010 - 07:47 AM

How should Yii know, which controller and action was requested if they are not contained in the URL?
0

#7 User is offline   Shridhar Somani 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 19-January 10

Posted 20 January 2010 - 09:03 AM

Hi Minase,
I know that it is possible with Frames and i have already implemented it with frames but i want to know about other solution, if it is possible.

Thanks!!!
0

#8 User is offline   Daniel M 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 19-January 10
  • Location:Germany, Saarland

Posted 20 January 2010 - 06:16 PM

If I understood you rightly, there is no "proper" solution. To be honest, I'm not even sure if you really want to do this.

Either do this by using frames, or do this by using ajax. Although ajax will prevent the user from being able to switch forward and backward in his browser history.

A third possibily is using POST requests only - one of our course management systems in university does so and I can tell you that it has nothing to do with usability.

Keep in mind that users will not be able to copy-paste the page's location from the url bar in order to tell give it to friends.
Utinam ea res tibi usui fuerit!
1

#9 User is offline   Daniel M 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 19-January 10
  • Location:Germany, Saarland

Posted 20 January 2010 - 06:18 PM

** double posting **
Utinam ea res tibi usui fuerit!
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