My Google+ Profile

Friday 17 May 2013

Removing index.php from URL Yii

I am working with this configuration without any problem, make sure that your apache is set up correctly to allow mod_rewrite and htaccess files and ofcourse the mod_rewrite engine is on.

Config :


'urlManager' => array(

  'urlFormat' => 'path',

  'showScriptName' => false,
),
 
 
Create .htaccess file in Application directory.
  
.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 

No comments:

Post a Comment