Pretty URLS are easy to read and helpful in SEO.
To take the benefits of pretty urls in Yii, please follow the below guidelines:
1) Open “main.php” configuration file of Yii.
It is located under your_application/protected/config/ folder
2) Paste the below lines in “components” array
‘urlManager’=>array(‘urlFormat’=>’path’, ‘showScriptName’=>false,),
3) Create “.htaccess” file in your application where “index.php” file is located
Add following lines to “.htaccess” file :
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
4) If your application is not showing pretty urls, then check whether your Apache configuration file i.e httpd.conf has the following module :
LoadModule rewrite_module modules/mod_rewrite.so
Remove “;” semicolon preceding the above line.
Save and restart the Apache server
hi Nagesh,
its nice to hear yii that you are working stuffs in it.
im in startup now in yii jus did installed basic site n also blog . after that i have no idea to move further . if you wish can you give up ur hands to move further in yii …
thanks in advance,
Gobi, Chennai, India .
hi Nagesh,
its nice to hear yii that you are working stuffs in it.
im in startup now in yii jus did installed basic site n also blog . after that i have no idea to move further . if you wish can you give up ur hands to move further in yii …
thanks in advance,
Gobi
Thanks for your comment. Nice to hear that you are using yii. May I know how can i help u?
Muchas gracias por la información!