Home  >  Article  >  Backend Development  >  CodeIgniter (CI) removes indexphp from the default url

CodeIgniter (CI) removes indexphp from the default url

WBOY
WBOYOriginal
2016-07-29 08:51:181001browse

1. Open the apache configuration file, conf/httpd.conf:

LoadModule rewrite_module modules/mod_rewrite.so

Remove the # before this line.

2. Search for AllowOverride None (there are many places in the configuration file), look at the comment information, and change the relevant .htaccess line information to:

AllowOverride All

3. In the directory of the same level as index.php and system, create .htaccess, file content

<IfModule rewrite_module>
    Options +FollowSymLinks
    IndexIgnore */*
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php
</IfModule>
4. Modify application/config/config.php
$config['index_page'] = 'index.php';

to

$config['index_page'] = '';


The above introduces CodeIgniter (CI) to remove indexphp in the default URL, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:header"Location:loginphp"Next article:header"Location:loginphp"