- 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>
推薦閱讀
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- 深入理解Java7:核心技術(shù)與最佳實(shí)踐
- Mastering LibGDX Game Development
- HTML5+CSS3+JavaScript Web開發(fā)案例教程(在線實(shí)訓(xùn)版)
- Android 應(yīng)用案例開發(fā)大全(第3版)
- 手把手教你學(xué)C語言
- Gradle for Android
- 零基礎(chǔ)入門學(xué)習(xí)Python(第2版)
- 執(zhí)劍而舞:用代碼創(chuàng)作藝術(shù)
- Android移動(dòng)開發(fā)案例教程:基于Android Studio開發(fā)環(huán)境
- R用戶Python學(xué)習(xí)指南:數(shù)據(jù)科學(xué)方法
- Python機(jī)器學(xué)習(xí)算法與應(yīng)用
- 編程改變生活:用Python提升你的能力(進(jìn)階篇·微課視頻版)
- SQL Server 2016 從入門到實(shí)戰(zhàn)(視頻教學(xué)版)
- Python數(shù)據(jù)可視化之美:專業(yè)圖表繪制指南(全彩)