Sure. You need to do two things, both are on this page: URL Management
You also need to create a .htaccess file to get rid of the index.php portion of the generated URL. The details of that are further down the page. Be sure to browse the comments at the end of the page as well in case something additional matches your situation.
I followed the article, tried all kind of things with httpd.conf, .htaccess and urlManager, but still isn’t working. My biggest problem is that I found everywhere FRAGMENTS of information, not the simple, clean, focused information. For example many folks write: “turn on AllowOverride”. But there is no syntax, how to do it. Also there are 3 occurrences in that really messy config file… Ahh.
So if anybody was/is in my situation, and made the things working, please help me…
Here is what I have currently:
I’m on win7 64 bit
installed apache 2.2. Configured the webroot to E:/www. (I always restart the server when changed something in conf)
installed php 5.3.8. Configured the time zone in php.ini, configured php in the httpd.conf
extract yii in e:\www. If I make an app with "yiic webapp blabla", it works
Everything is working fine until this point in my learning curve. I’m stuck at making url’s fine. I always get stuff like localhost/framework/testdrive/index.php/site/index. I want instead localhost/framework/testdrive/index or localhost/framework/testdrive/contact, etc.
It is possible to have clean urls on localhost?
If yes, please tell me:
what to change to what in httpd.conf
what to write in .htaccess and where to put this file (I just saw too many configurations that is supposed to do the same thing, so I’m totally confused) I can’t see how to check if the .htaccess file is actually working (doing what is supposed to do)
what to write in the array of urlmanager: ‘urlManager’=>array( ? );
is there anything else to make/change?
I’m sorry if my post sounds childish or stupid but I simply tried so many things that simply doesn’t work.
That’s exactly what I do after creating a new app and it works for me.
If you want to get rid of site/contact part of url you will propably have to edit ‘rules’ part of urlManager configuration. However it’s a huge topic and you should look for answers in manual, and CUrlManager class documentation.