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

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>
主站蜘蛛池模板: 康定县| 深圳市| 内黄县| 新邵县| 漳浦县| 舒城县| 游戏| 沁阳市| 勃利县| 日喀则市| 长武县| 辽宁省| 元朗区| 天等县| 临泉县| 华池县| 清流县| 忻城县| 南丹县| 彭泽县| 蒙山县| 永胜县| 莎车县| 太和县| 肥东县| 志丹县| 偃师市| 青田县| 新宁县| 晋江市| 牙克石市| 长泰县| 高清| 康乐县| 武强县| 枣强县| 平昌县| 汝城县| 南安市| 景谷| 宁河县|