duanfei1987 2012-11-21 07:31
浏览 50
已采纳

使用codeigniter中的htaccess隐藏index.php后,登录URL重定向到主页 - [Codeigniter url重定向问题]

I am developing a shopping cart site using Codeigniter Gocart script. I hid index.php using htaccess. When I try to login using localhost/project143/secure/login, it works fine and goes to login page. But when I try the login link in live as hostname/projects/project143/secure/login, it redirects to home page instead of login page.The login page with index.php in the URL (http://hostname/projects/project143/index.php/secure/login) is opening login page well. I've attached the screenshot of my issue and redirection code for clarification. Anyone knows this issue and fix ?

.htaccess

    RewriteEngine on
    RewriteBase /projects/project143/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|assets|uploads|robots\.txt)
    RewriteRule ^(.*)$ index.php/$1 [L]

Home Page: enter image description hereLogin Page with index.php included in URL: enter image description hereLogin Page without index.php in the URL: enter image description here

  • 写回答

1条回答 默认 最新

  • dreamone5156 2012-11-21 07:51
    关注

    Here it is solution How to remove "index.php" in codeigniter's path

    Try user unicorn's answer.it will work.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记