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

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>
主站蜘蛛池模板: 祁门县| 高淳县| 吴川市| 兖州市| 辉南县| 驻马店市| 大名县| 凤台县| 镇远县| 辽宁省| 东平县| 淅川县| 岱山县| 井研县| 台东县| 鹤岗市| 梅河口市| 潢川县| 义乌市| 鄂伦春自治旗| 鲁甸县| 西安市| 镇巴县| 怀化市| 上虞市| 五河县| 扎赉特旗| 屏山县| 禄丰县| 沙坪坝区| 蕲春县| 鄂托克前旗| 依安县| 南木林县| 吉水县| 兴安盟| 金堂县| 玉山县| 新绛县| 六盘水市| 图们市|