更新时间:2022-09-12 18:59:17
Maybe it looks simple, but some time ago I need some time to find a solution of this case. I finally got it, and I want to share that I also experienced such cases. So that it can make reference.
Neither let us do the steps:
change this setting :
#LoadModule rewrite_module modules/mod_rewrite.so
to be
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
if above does not work try with this:
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
www - protected - index.php - .htaccess
'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false, 'caseSensitive'=>false, ),
For reference material I managed to do in my personal website (check my profile).
NB: This for hide index.php
Total 12 comments
Also, if you're on a virtual directory (e.g. using
on your apache configuration) you MUST use a
statement on your .htaccess file, other than the rewrite won't work again.