Setting up a permanent 301 redirect is quite easy for users having Cpanel or similar control panel. But what if we are using a webserver that does not support the .htaccess file ?
Here below is the code that you can use in a php file to set a permanent 301 redirect.
Note: This code should be at top and before any output code.
Here below is the code that you can use in a php file to set a permanent 301 redirect.
Just edit the destination url and place the code in your file that you want to redirect.PHP Code:
<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header("Location: http://www.google.com");
?>
Note: This code should be at top and before any output code.
No comments:
Post a Comment