繁体   English   中英

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

[英]Login url redirects to home page after hiding index.php using htaccess in codeigniter - [Codeigniter url redirection issue]

我正在使用Codeigniter Gocart脚本开发购物车网站。 我使用htaccess隐藏了index.php。 当我尝试使用localhost / project143 / secure / login登录时 ,它可以正常工作并进入登录页面。 但是当我在live中尝试登录链接作为hostname / projects / project143 / secure / login时 ,它会重定向到主页而不是登录页面。在URL中使用index.php的登录页面( http:// hostname / projects / project143) /index.php/secure/login )正在打开登录页面。 我已附上我的问题和重定向代码的屏幕截图以便澄清。 任何人都知道这个问题并修复?

的.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]

主页: 在此输入图像描述 URL中包含index.php的登录页面: 在此输入图像描述 URL中没有index.php的登录页面: 在此输入图像描述

这里是解决方案如何删除codeigniter路径中的“index.php”

试试用户独角兽的答案。它会起作用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM