Home > Backend Development > PHP Problem > How to remove index.php from ci url

How to remove index.php from ci url

藏色散人
Release: 2023-03-09 18:46:01
Original
1719 people have browsed it

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.

How to remove index.php from ci url

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

##Search

rewrite_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/

codeIgniter

/index.php/ userRestart Apache and access http://localhost/codeIgniter/user directly

Recommended: "

PHP Video Tutorial

"

The 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!

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