Welcome Guest, Not a member yet? Register   Sign In
Dynamic setting of base_url breaks redirection
#1

[eluser]Unknown[/eluser]
i need to support multiple sites so i tried setting the $config['base_url'] value dynamically on page load this way as recommended by others:

$config['base_url'] = "http://".$_SERVER['HTTP_HOST'];

it works fine until i need to redirect from a controller function. After processing some form post data i do a redirect like this for example: redirect("/community/questions"); and then i get a server error in Chrome "Fix Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data."

i also tested in IE and it doesn't work there either. Works in FF however. When go back and hardcode the base url the redirection works fine.

Anybody else ever have this issue?




Theme © iAndrew 2016 - Forum software by © MyBB