yii hide index.php


/ Published in: Apache
Save to your folder(s)

Hiding index.php from url


Copy this code and paste it in your HTML
  1. File: .htaccess
  2.  
  3. LoadModule rewrite_module modules/mod_rewrite.so
  4.  
  5.  
  6.  
  7. RewriteEngine On
  8. RewriteBase /
  9. RewriteCond %{REQUEST_FILENAME} !-f
  10. RewriteCond %{REQUEST_FILENAME} !-d
  11. RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
  12.  
  13.  
  14.  
  15. RewriteEngine on
  16.  
  17. # if a directory or a file exists, use it directly
  18. RewriteCond %{REQUEST_FILENAME} !-f
  19. RewriteCond %{REQUEST_FILENAME} !-d
  20.  
  21. # otherwise forward it to index.php
  22. RewriteRule . index.php
  23.  
  24.  
  25.  
  26.  
  27.  
  28. File : conifg/main.php
  29.  
  30. 'urlManager'=>array(
  31. 'urlFormat'=>'path',
  32. 'showScriptName'=>false,
  33. 'caseSensitive'=>false,
  34. ),

URL: http://www.yiiframework.com/wiki/214/url-hide-index-php/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.