Tuesday, December 30, 2014

Remove index.php from url YII

Standard



create .htaccess under www-->yiisitename 

add following code on .htaccess


Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

http://localhost/sitename/index.php   - default yii url

http://localhost/sitename/  - now run like this

1 comment: