【发布时间】:2015-01-19 08:36:43
【问题描述】:
您好,我正在使用 codeigniter,当我在浏览器中键入我的基本 URL 时,我想重定向到默认控制器。
我的基本网址
http://localhost/itams/index.php
我的默认路线
$route['default_controller'] = "new_starter/listing";
我的问题是当我在浏览器中输入http://localhost/itams/index.php 时,它正确地重定向到new_starter/listing 页面,但浏览器URL 没有改变。它显示为http://localhost/itams/index.php。
这是默认行为吗?
如何更改浏览器 URL?
我必须使用
header()进行手动重定向吗?
提前致谢。
【问题讨论】:
-
更改基本网址?
-
@RakeshSharma 对不起,我没有明白你的意思,你能解释一下吗:)
-
它应该在默认控制器上重定向。你有路由吗?也从 url 中删除 index.php
-
@RakeshSharma 默认控制器是 'new_starter/listing' ,它正在重定向到默认控制器,但浏览器 URL 停留在 'localhost/itams/index.php' ,我认为我有点误导。
-
不,我没有。 URL重定向和'index.php'有什么联系吗?
标签: php .htaccess codeigniter redirect