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

CodeIgniter (CI) removes indexphp from the default url

WBOY
Release: 2016-07-29 08:51:18
Original
1022 people have browsed it

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

LoadModule rewrite_module modules/mod_rewrite.so
Copy after login

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
Copy after login

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>
Copy after login
4. Modify application/config/config.php
$config['index_page'] = 'index.php';
Copy after login

to

$config['index_page'] = '';
Copy after login


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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template