URL rewriting in Yii to hide index.php
To hide the index.php from url you have to make the changes in config/main.php as shown below,
You can change the ”RewriteBase /’ as per project location like if project is located in ‘abc/′ of webroot.then it change like as RewriteBase /abc
That will make sure your auto-generated links (CHtml::link or zii.widgets.CMenu) do not have index.php in them. This will not work without the .htaccess file. The reason is that the .htaccess file rewrites the url to point to index.php/$1 so that Yii actually gets the request properly. You will not see the index.php in the url at any time though.
No comments:
Post a Comment