用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2261|回复: 8
收起左侧

求救--- redirect 路转后 URL完全不正常

[复制链接]
发表于 2013-3-1 17:24:07 | 显示全部楼层 |阅读模式
各位好。

版本 CodeIgniter_2.1.3

我是在一个表单处理后 进行跳转 代码如下:

控制器:reg
redirect('welcome');   需要说明的事现在我的表单里面任何事情都不作处理,只作这一个跳转。

但点跳转后的URL 竟然完全不正常 竟然变成如下:  http://localhost/test/reg/localhost/test/index.php/welcome


紧急求救。。。。谢谢

路由配置:

$route['reg'] = "reg";
$route['default_controller'] = "index";
$route['404_override'] = '';

发表于 2013-3-1 17:32:23 | 显示全部楼层
你没设置 $config['base_url'] 吧?看看你的 config.php
 楼主| 发表于 2013-3-1 17:40:35 | 显示全部楼层
设置成这个:$config['base_url']        = 'localhost/test';

谢谢
 楼主| 发表于 2013-3-1 17:51:44 | 显示全部楼层
跪救救
发表于 2013-3-1 19:43:59 | 显示全部楼层
$config['base_url']要么置空,要么http://localhost/test
 楼主| 发表于 2013-3-4 13:06:14 | 显示全部楼层
谢谢 Hex 谢谢 曜日晨阳

原因是没加 http://

发表于 2013-9-19 16:37:26 | 显示全部楼层
曜日晨阳 发表于 2013-3-1 19:43
$config['base_url']要么置空,要么http://localhost/test

非常感谢,你的回答帮助了我,我还是too young too simple了一点。
发表于 2013-9-30 13:33:58 | 显示全部楼层
发表于 2013-9-30 14:34:19 | 显示全部楼层
site 可以使用 site_url() 来格式化~

本版积分规则