官术网_书友最值得收藏!

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:

  1. 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
      
  2. 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>
主站蜘蛛池模板: 都安| 颍上县| 新津县| 玉门市| 扎囊县| 南宁市| 东方市| 滨州市| 冀州市| 伽师县| 雷州市| 昆山市| 靖州| 定结县| 鸡西市| 称多县| 望城县| 泾阳县| 金湖县| 普定县| 酒泉市| 无锡市| 涟源市| 西充县| 丰原市| 靖江市| 色达县| 汾阳市| 逊克县| 明溪县| 钟山县| 香河县| 桓台县| 宁德市| 赞皇县| 木兰县| 江都市| 正蓝旗| 千阳县| 吴川市| 金华市|