Home > Backend Development > PHP Problem > How to hide index.php in ci

How to hide index.php in ci

coldplay.xixi
Release: 2023-03-03 21:22:01
Original
2105 people have browsed it

ci隐藏index.php的方法:首先打开【rewrite_module】,并修改AllowOverride none为AllowOverride All;然后在CI的目录下面创建【.htaccess】文件并添加相关内容;最后相关内容即可。

How to hide index.php in ci

ci隐藏index.php的方法:

1.需要apache打开rewrite_module,然后修改httpd.conf的AllowOverride none为AllowOverride All(里面,不同的环境目录不同)

2.在CI的目录下面创建.htaccess文件,加入如下内容:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\\.php|images|robots\\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
Copy after login

3.修改config.php的内容:

$config['index_page'] = 'index.php';
Copy after login

替换为

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

相关学习推荐:php编程(视频)

The above is the detailed content of How to hide index.php in ci. 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