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

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>
主站蜘蛛池模板: 凤城市| 瓦房店市| 涪陵区| 恩施市| 抚宁县| 宣武区| 镇江市| 伊金霍洛旗| 钟祥市| 宝山区| 邳州市| 兴隆县| 得荣县| 乐昌市| 晋江市| 肇源县| 运城市| 太保市| 郯城县| 北安市| 哈巴河县| 墨脱县| 崇仁县| 尉犁县| 虎林市| 会泽县| 巨鹿县| 白玉县| 应用必备| 连州市| 房山区| 芦溪县| 镇巴县| 理塘县| 中江县| 容城县| 和龙市| 阳西县| 高台县| 班戈县| 太谷县|