I know how to 301 redirect using .htaccess file but how can I do it with PHP and show a message after the user has been redirected or before I don't really care?
Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.
PHP 301 redirect with message?
You need to return HTTP / HTTPS 301 header first.
Now you need to specify where the content is permanently redirected.
This will refresh after 3 second ideal for showing message during that time!
or
This will redirect straightaway!
To show redirect message.
Final 301 redirect with message code.
PHP Code:
header("HTTP/1.1 301 Moved Permanently");
Now you need to specify where the content is permanently redirected.
This will refresh after 3 second ideal for showing message during that time!
PHP Code:
header("refresh:3; http://redirect-site.com");
This will redirect straightaway!
PHP Code:
header("location: http://redirect-site.com");
To show redirect message.
PHP Code:
echo 'Redirect message goes here';
Final 301 redirect with message code.
PHP Code:
<?
header("HTTP/1.1 301 Moved Permanently");
header("refresh:3; http://redirect-site.com");
echo 'Redirect message goes here';
exit();
?>
User(s) browsing this thread: 1 Guest(s)