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.

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

报告相同问题?