PHP has a lot of functions to do the same thing that you have to do manually in other languages. This
is identical to this
5:35 pm on May 21, 2012 (gmt 0)
>> is identical to this
The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless the 201 or a 3xx status code has already been set.
6:13 pm on May 21, 2012 (gmt 0)
Hi ifuturz, welcome to WW.
Like mentioned above header is used for redirection (using "location"). Also you can use header function for setting the HTTP return code of the document, such as:
header('HTTP/1.0 404 Not Found');
But you can't have anything printed prior this (it will automatically return 200), so put it as high in the conditional code as possible.
9:34 pm on May 21, 2012 (gmt 0)
Add a trailing slash after the .com part. The canonical URL should include a trailing slash.
Make sure you set this as a 301 redirect. The default as coded above is for a 302 redirect.