[eluser]Daniel Moore[/eluser]
Ok, 3 things we need to do here.
Number one, we need to add an "exit;" to prevent any code below the redirect from being executed. It is important to note that headers are actually sent when the first byte is output to the browser. If you are replacing headers in your scripts, this means that the placement of echo/print statements and output buffers may actually impact which headers are sent. In the case of redirects, if you forget to terminate your script after sending the header, adding a buffer or sending a character may change which page your users are sent to.
Number 2, we need to add the trailing slash.
The 3rd thing I neglected to point out is that some browsers will not redirect unless the Status is sent first. (Chrome, for example.) I have added this, and you can set the redirect status to suit your needs.
"Location:" must be capitalized, which you already have, as some browsers will not redirect if it is not.
Try this:
Code:
<?php
if (isset($_GET['view']))
{
$redirect = 'Location: http://example.com/page/id/'.$_GET['view'].'/';
header("Status: 301");
header($redirect);
exit;
}
and change example.com to your site. And clear the browser cache when you test it, just in case.