planix
Technical User
- Dec 3, 2002
- 22
Hi,
I know that there is a problem with IIS and redirecting using the header() function. But, does anyone have a workaround for this code?
The purpose of the code is to build an expression ($url) to redirect to and then redirect to that built location.
The problem is, obviously, that nothing happens because it is IIS trying to use the header() function and doing some obscure thing with the 302 (whatever that is!) page.
Anyway, can somebody give me any clues as to how to redirect the page without using location() or by adding some smart bit of meta tag processing?
Many thanx
Alistair
I know that there is a problem with IIS and redirecting using the header() function. But, does anyone have a workaround for this code?
The purpose of the code is to build an expression ($url) to redirect to and then redirect to that built location.
Code:
function redirect($url, $includeJournal = true) {
if (!preg_match('!^https?://!i', $url)) {
$url = Request::getBaseUrl() . '/' . $url;
}
header("Location: $url");
exit();
}
The problem is, obviously, that nothing happens because it is IIS trying to use the header() function and doing some obscure thing with the 302 (whatever that is!) page.
Anyway, can somebody give me any clues as to how to redirect the page without using location() or by adding some smart bit of meta tag processing?
Many thanx
Alistair