News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gaurish Patil's Blog:
URL rewriting in Yii to hide index.php
April 20, 2012 @ 09:27:06

In this new post to his blog Gaurish Patil shows users of the Yii framework how they can update their configuration settings to hide the "index.php" in their requests and make cleaner URLs.

Finally we figure out the basics of Yii. While working on basic of Yii, I want to rewrite the url to SEO friendly. So I started to search on google, forum got useful information here http://www.yiiframework.com/doc/guide/1.1/en/topics.url To hide the index.php from url I did changes in config/main.php [...] and I created new .htaccess file in the same directory as my index.php file.

The changes are pretty simple - it's mostly a change to the "urlManager" setting to provide some rules for mapping controller and actions to the right place. The .htaccess file uses Apache's mod_rewrite functionality to grab the requested URL and remap it back to lay on top of the "index.php" front controller for the request.

0 comments voice your opinion now!
url rewrite yii framework urlmanager htaccess


blog comments powered by Disqus

Similar Posts

Reddit.com: My new boss is convinced Symfony2 is not suitable for big projects...

New Relic Blog: 25 PHP Developers to Follow Online

Felix Geisendorfer's Blog: Modeling relationships in CakePHP (faking Railsí ThroughAssociation)

SitePoint PHP Blog: What to Expect from Yii 2.0

Symfony Blog: Symfony November Camp in Sweden


Community Events

Don't see your event here?
Let us know!


community opinion api yii2 podcast list example programming interview application composer part2 php7 language laravel framework introduction project symfony series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework