douzhiba6873 2015-04-11 05:07
浏览 33

放入子文件夹时,从url codeigniter中删除index.php

i want to remove index.php from url . i put codeigniter file in subfolder

http://192.168.2.8/mydomain_folder/subdomain_folder/index.php/admin_controls

want to get it as

   http://192.168.2.8/mydomain_folder/subdomain_folder/admin_controls

.htacess file

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico|public)
RewriteRule ^(.*)$ /app_staging/index.php/$1 [L]
</IfModule>

where to place the .htacess files

I put 1 at the root folder and another inside application folder.

  • 写回答

2条回答 默认 最新

  • douhan9619 2015-04-11 05:50
    关注

    Add this code in top of your .htaccess file

      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond $1 !^(index\.php|images|robots\.txt)
       RewriteRule ^(.*)$ index.php?/$1 [L]
    

    Put it in root folder where index.php is available. test on your server have mod_rewrite enabled?

    评论

报告相同问题?

悬赏问题

  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能