Remove index. php from the default url of CodeIgniter (CI). Step 1: Open the apache configuration file, confhttpd. conf: LoadModulerewrite_modulemodulesmod_rewrite.so, and remove the # Before this line. Search for AllowOverrideNone (there are multiple configuration files), view the comments, and send the related. htaccess line
To remove index. php from the default url of CodeIgniter (CI), follow these steps: 1. Open the apache configuration file: conf/httpd. conf: LoadModule rewrite_module modules/mod_rewrite.so. Search for AllowOverride None (there are multiple configuration files), view the comments, and send the related. htaccess line
To remove index. php from the default CodeIgniter (CI) url:
1. Open the apache configuration file, conf/httpd. conf:
LoadModule rewrite_module modules/mod_rewrite.so
Remove the # Before the row.
Search for AllowOverride None (there are multiple configuration files), view the comments, and change the related. htaccess row information:
AllowOverride All
2. under the root directory of CI, that is, in index. php, system directory at the same level, create. htaccess, directly creating the file name will not succeed, you can first create a notepad file, save it as a file with this name. The content is as follows (this is also introduced in the CI manual ):
RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L]
If the file is not in the root directory of www, for example, my file is:
http://localhost/ci_demo_1/index.php/
The third line needs to be rewritten
RewriteRule ^(.*)$ /CI/index.php/$1 [L]
In addition, the assets folder under the same directory of my index. php needs to be filtered out, and the second line needs to be rewritten:
RewriteCond $1 !^(index\.php|images|assets|robots\.txt
3. In the CI configuration file (application/config. php)
$config['index_page'] = "index.php";
Change
$config['index_page'] = "";
Restart apache.
========================================================== ========================================================== ========================================================== =
Php framework ci de-index. php Method
There are many methods to introduce online. if the htaccess file is a dynamic or static file in the test environment, some problems may occur during the test (because all files are directed to the index. php), static Web pages cannot be accessed.
Here, we provide a method to modify the http. conf file,
Steps:
1: add
Options Indexes FollowSymLinks AllowOverride all Order allow,deny Allow from all
RewriteEngine on RewriteRule ^/script/(.*) /script/$1 [L] RewriteRule ^(.*)$ /index.php?/$1 [L]
2. Remove the following line.
LoadModule rewrite_module modules/mod_rewrite.so
3. Restart apache without adding the. htaccess file.