For example, your original path is http://localhost/test/index.php/index/add.
So now the address is Http://localhost/test/index/add
How do you get rid of index.php?
1, httpd.conf configuration file loaded with the Mod_rewrite.so module//in Apache to configure
Copy Code code as follows:
#LoadModule rewrite_module modules/mod_rewrite.so To remove the siren from the front.
2. allowoverride None speak none to all//in Apache (note that all other allowoverride are set to all)
Copy Code code as follows:
<directory "D:/server/apache/cgi-bin" >
allowoverride None Change allowoverride all
Options None
Order Allow,deny
Allow from all
</Directory>
3, to ensure that the Url_model set to 2, in the project's configuration file to write
Copy Code code as follows:
Return Array (
' Url_model ' => ' 2 ',
);
4. htaccess files must be placed in the directory
This file adds:
Copy Code code as follows:
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]
</IfModule>
Add: You can't create a file that starts with a dot under windows, you can create a file first
Then in DOS in the Operation rename Xxxx.xxxx. htaccess