Is this a correct URI for the header('Location: ')
, specifically ./
?
header ('HTTP/1.1 301 Moved Permanently');
header ('Location: ./');
Thank you.
Answer: Use the PHP header() Function You can simply use the PHP header() function to redirect a user to a different page. The PHP code in the following example will redirect the user from the page in which it is placed to the URL http://www.example.com/another-page.php . You can also specify relative URLs.
You can also use:
header('Location: /', false, 301);
I assume you want to redirect to the 'homepage', that'd be / instead of ./
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With