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

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>
主站蜘蛛池模板: 平顶山市| 邢台市| 石台县| 当阳市| 阜南县| 兖州市| 黑龙江省| 依兰县| 延长县| 谢通门县| 米易县| 延寿县| 佛山市| 长兴县| 两当县| 常熟市| 璧山县| 合阳县| 齐齐哈尔市| 浏阳市| 格尔木市| 泰宁县| 紫云| 新安县| 屏山县| 额尔古纳市| 梁河县| 井陉县| 安福县| 名山县| 拉萨市| 安达市| 晋州市| 类乌齐县| 古蔺县| 麻城市| 曲靖市| 抚松县| 阳原县| 莱阳市| 昌平区|