I made a very easy snippet:
$url = $modx->makeUrl($id);// page id to redirect to
$modx->sendRedirect($url, 0, ’REDIRECT_HEADER’, ’301’); // redirect to url with the code 301
When this snippet is called on a specific page with $id parameter set to target page it works and redirects. But, there is a problem - when looking in Apache logs, it always uses 302 code instead of 301. I also tried with ’301 some text here’ but same result - always 302 redirect. I looked into source code of sendRedirect function and I see no problems there... any ideas?
Possibly a bug in MODx?
-
MODX Staff
- 10,725 Posts
Thanks for pointing that out phazze. That probably could use a more abstract way to set those values so it could send HTTP/1.1 or 1.0 appropriately based on the server capabilities, though I’m not sure if that is really an issue for anyone.