- CodeIgniter Web Application Blueprints
- Rob Foster
- 124字
- 2021-08-06 19:34:27
Removing index.php from the address bar
It is possible to remove index.php
from the web browser address bar when CodeIgniter is running. This can be done by following these steps:
- Create or open a
.htaccess
file. If a.htaccess
file does not already exist, you can create one using the following:- Linux/Mac: Open a terminal window and type the following:
touch /path/to/CodeIgniter/.htaccess
- Windows: Create a text file in your CodeIgniter root, naming it
file.htaccess
. Hold down the Windows key and then press R to open the Run dialogue. Enter the following command and click on OK:ren "C:\path\to\CodeIgniter\file.htaccess" .htaccess
- Linux/Mac: Open a terminal window and type the following:
- Once your
.htaccess
file is opened, write the following lines at the top of the file:<IfModule mod_rewrite.c> RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
推薦閱讀
- R語言數據分析從入門到精通
- Java系統分析與架構設計
- Visual C++串口通信開發入門與編程實踐
- Python爬蟲開發:從入門到實戰(微課版)
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- Python編程與幾何圖形
- Go并發編程實戰
- The Complete Coding Interview Guide in Java
- 數據結構習題解析與實驗指導
- Software-Defined Networking with OpenFlow(Second Edition)
- 高性能PHP 7
- Python Linux系統管理與自動化運維
- Getting Started with Web Components
- Hands-On ROS for Robotics Programming
- C語言程序設計