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 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)
  • ¥15 机器人轨迹规划相关问题
  • ¥15 word样式右侧翻页键消失