I have a url which initially h开发者_Python百科ttp://web.com/index.php/home/funct/ and I want to change this by removing the index.php so that it becomes http://web.com/home/funct/
If you are using Apache server, create a file called .htaccess
and put this in it:
<IfModule mod_rewrite.c>
RewriteEngine on
# If the file/dir is NOT real go to index
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>
Then just remove the reference to "/index.php/" from your links and when the server doesn't find "home/funct" it will go looking for "/index.php/home/funct".
精彩评论