Friday, April 15, 2011

Hide index.php in Yii on XAMPP

Hiding index.php in yii

1.Go to your project directory i.e. htdocs/projectname create a .htaccess file
copy this in .htaccess file

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

2.Go to \xampp\apache\conf folder then open httpd.conf file uncomment the line

LoadModule rewrite_module modules/mod_rewrite.so

3. We need to change the AllowOverride directive also


Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all


to


Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Satisfy all



5.Now restart the server and try the url.