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

How to hide index.php in ci

Aug 06, 2020 am 10:03 AM
ci index.php

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1655
14
PHP Tutorial
1252
29
C# Tutorial
1226
24
CI vs Laravel: Which framework is better for building a blog or CMS website? CI vs Laravel: Which framework is better for building a blog or CMS website? Jun 19, 2023 am 08:54 AM

With the continuous development and upgrading of website construction, choosing a framework that suits you has become an essential skill for website builders. This article will briefly analyze CI and Laravel to help you choose a framework that is more suitable for building a blog or CMS website. 1. Introduction to CI CodeIgniter, referred to as CI, is an open source lightweight web application development framework that adopts the MVC architecture model. CI can run on PHP5.2 and above, and includes many commonly used libraries and helper functions, making it possible to use CI to develop web applications.

How to remove index.php from the server How to remove index.php from the server Dec 19, 2022 am 10:24 AM

How to remove index.php from the server: 1. Open the php.ini file and change the content to "cgi.fix_pathinfo=1"; 2. Modify the configuration file of the corresponding virtual host; 3. Change "include enable-php.conf;" Replace with "include enable-php-pathinfo.conf;"; 4. Remove index.php and restart lnmp.

Explore the innovative features of PHP framework: from CI to Yii Explore the innovative features of PHP framework: from CI to Yii Nov 27, 2023 am 10:04 AM

With the rapid development of the Internet, the application of PHP language is becoming more and more widespread. In order to improve development efficiency, reduce development costs and adopt best practices, the PHP framework came into being. Among them, CodeIgniter (CI) and Yii are two well-known PHP frameworks. This article will explore these two frameworks from the perspective of innovation capabilities. CodeIgniter (CI) is a lightweight PHP framework that is widely used for rapid development of web applications. The main features of CI are ease of use, speed and flexibility. exist

How to remove index.php from https URL How to remove index.php from https URL Mar 20, 2023 pm 03:35 PM

The string index.php often appears in the URLs of many websites. Although this file is very important, sometimes users want to remove this string from their URLs to make the website structure clearer.

How to hide index.php in tp3 How to hide index.php in tp3 Mar 03, 2023 am 10:18 AM

How to hide index.php in tp3: 1. Find and open the "Application/Common/Conf/config.php" file; 2. Turn on REWRITE mode by modifying "return array('URL_MODEL'=> 2,);".

How to hide index.php in lnmp How to hide index.php in lnmp Oct 21, 2022 am 10:12 AM

How to hide index.php in lnmp: 1. Open the "location ~ [^/].php" file; 2. Modify the content to "location ~ [^/].php"; 3. Remove "#try_files $uri =404; The # symbol in front of "; 4. Add the content "rewrite "^/(.*)$" /index.php last;"; 5. Restart Nginx.

How to use C++ function unit testing with continuous integration (CI)? How to use C++ function unit testing with continuous integration (CI)? Apr 24, 2024 pm 03:42 PM

Answer: Using continuous integration (CI) combined with C++ function unit testing can automate code testing and ensure code quality and reliability. Install CMake and the unit test framework: GoogleTest: sudoaptinstalllibgtest-devCatch2: sudoaptinstalllibcatch2-dev Write unit tests: Write code tests using a unit test framework such as GoogleTest Configure CMake: Add unit tests in CMakeLists.txt Run tests in CI: Configure CI Systems (like Jenkins) run tests on every push

How to use CI5 framework in php? How to use CI5 framework in php? May 31, 2023 pm 03:31 PM

With the continuous development of web development technology, using frameworks has become one of the daily tasks of modern developers. Among them, the CI framework has received widespread attention because of its simplicity and ease of use. This article will introduce readers to the use of the CI5 framework and how to use it flexibly in PHP development. 1. What is the CI5 framework? The CI5 framework (CodeIgniter5) is a web application framework based on the MVC design pattern and developed using PHP language. The main goal of CI5 framework is to develop web applications quickly

See all articles