Ci default rewrite URL is similar to this, for example, your CI root directory is under/codeigniter/, your below level two URL is similar to this http://localhost/CodeIgniter/index.php/welcome. Not too good-looking, how to take out the index.php?
1. Open the Apache configuration file, conf/httpd.conf:
LoadModule rewrite_module modules/mod_rewrite.so, remove the # before the line.
Search AllowOverride None (there are multiple places in the configuration file), look at the comment information, change the line information of the related. htaccess to allowoverride all.
2. Under the CI root directory, that is, in the index.php,system of the same sibling directory, the establishment of the. htaccess, directly establish the file name is not successful, you can first create a Notepad file, save as the name of the file. The content is as follows (also described in the CI manual):
Copy CodeThe code is as follows:
Rewriteengine on
Rewritecond $!^ (index\.php|images|robots\.txt)
Rewriterule ^ (. *) $/index.php/$1 [L]
If the file is not in the root directory of WWW, for example my is: http://www.nowamagic.net/CodeIgniter/, the third line needs to be rewritten as Rewriterule ^ (. *) $/codeigniter/index.php/$1 [L].
In addition, my index.php's sibling directory also has JS folder and CSS folder, these need to filter to remove, the second line needs to be rewritten as: Rewritecond $!^ (index\.php|images|js|css|robots\.txt)
3. $config[' Index_page ' in the profile in CI (system/application/config/config.php) = "index.php"; $config[' index_page ') = ""; 。
Copy CodeThe code is as follows:
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
| Typically this would be your index.php file, unless you ' ve renamed it to
| Something else. If you is using mod_rewrite to remove the page set this
| Variable So, it is blank.
*/
$config [' index_page '] = ';
Restart Apache
http://www.bkjia.com/PHPjc/327910.html www.bkjia.com true http://www.bkjia.com/PHPjc/327910.html techarticle ci default rewrite URL is similar to this, for example, your CI root directory is under/codeigniter/, your below level two URL is similar to this http://localhost/CodeIgniter/index.php/welcome. No ...