我在这方面很难。好吧,我使用 codeigniter 创建了一个登录页面,其中整个路径将http://localhost/CodeIgniter_2.1.3/index.php
被重写为http://localhost/login
使用 .htaccess。好吧,它工作得很好,但问题是在我成功登录并且页面使用 redirect('next_page'); 重定向到下一页之后;因为 URL 将http://localhost/CodeIgniter_2.1.3/index.php/next_page
代替http://localhost/next_page
. 我还为那部分创建了一个重写规则:
RewriteRule ^events$ /CodeIgniter_2.1.3/index.php/events [L,NC]
并且每当我在http://localhost/next_page
地址栏中键入时,页面就会显示得很好(因为我没有在登录和此页面上应用任何规则。)我还尝试使用 redirect('http://localhost/events'); 这也可以正常工作,但我仍然知道这不是真正的解决方案。哦,顺便说一句,我的 .htaccess 存在于 wampserver 的 www 文件夹中。有什么办法可以解决这个问题?