Three methods are passed in at the same time U(MODULE_NAME . '/Public/index') When using this URL parameter,
redirect will generate multiple addresses for index.php, causing access errors, but when using URL_MODEL=2 pseudo-static, there is no problem
View the redirect source code:
/** * Action跳转(URL重定向) 支持指定模块和延时跳转 * @access protected * @param string $url 跳转的URL表达式 * @param array $params 其它URL参数 * @param integer $delay 延时跳转的时间 单位为秒 * @param string $msg 跳转提示信息 * @return void */ protected function redirect($url,$params=array(),$delay=0,$msg='') { $url = U($url,$params); redirect($url,$delay,$msg); }
Because redirect requires a string and not an address generated by the U function!
The difference between success and error is that they do not use U internally to generate the URL when it needs to be passed in.