hello firend if u need a SEO friendly URL
Go to ur .htaccess file in and use this code carefully
RewriteEngine on RewriteBase / # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php) # otherwise forward it to index.php RewriteRule ^(.+)$ yourproject/index.php?$1 [PT,L,QSA]
this code will remove the index.php in the URL For eg. www.example.com/index.php/yourview to www.example.com/yourview
RewriteRule ^(.+)$ index.php?$1 [PT,L,QSA] (if ur in root use this line "RewriteRule ^(.+)$ index.php?$1 [PT,L,QSA]" instead of "RewriteRule ^(.+)$ yourproject/index.php?$1 [PT,L,QSA]" )
Total 4 comments
this is already provided by yii. please the docs of wiki.
thanks for this article. can you add configuration to nginx?
2karminski
but guide can not help to remove index.php in url. check your sites - all links available with index.php in it.
this is for those who work with .htaccess
I'm sorry, my friend, by that post is meaningless. Yii guide contains sufficient information about URL Management.
Leave a comment
Please login to leave your comment.