Home >Backend Development >PHP Problem >How to remove index.php from ci url
How to remove index.php from ci url: first modify the configuration file; then search for htaccess and change AllowOverride None to "AllowOverride All"; finally create a ".htaccess" file.
The operating environment of this article: Windows 7 system, CodeIgniter version 3.0, DELL G3 computer
Remove index.php:
First modify the configuration file, $config['index_page'] = ' '; Set empty
Then modify Apache and search for htaccess Change AllowOverride None to AllowOverride All
##Searchrewrite_module modules/mod_rewrite.so Open and remove
#In the root directory of CI, in the directory of the same level as system, create a.htaccess file (use Notepad to create .htaccess) and write the following content:
##RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)RewriteRule ^( .*)$ /
codeIgniter
/index.php/$1 [L]My project address is http://localhost/
/index.php/ userRestart Apache and access http://localhost/codeIgniter/user directly
Recommended: "
PHP Video TutorialThe above is the detailed content of How to remove index.php from ci url. For more information, please follow other related articles on the PHP Chinese website!