301 Redirect using PHP Home › Forums › PHP › 301 Redirect using PHP Tagged: php, redirect This topic has 0 replies, 1 voice, and was last updated 6 years, 11 months ago by Usman Haider. Viewing 1 post (of 1 total) Author Posts June 12, 2015 at 9:10 pm #677 Usman HaiderKeymaster Most common and best way for redirecting your website to a new website is by using a 301 permanent redirect in PHP. Here is its usage: 301 Permanent Redirect in PHP PHP <?php header("HTTP/1.1 301 Moved Permanently"); //this is a header for telling bots about the permanent redirect header("Location: http://earlysandwich.com/new_page.html"); //this line tells the address of a new page for redirecting a user or bot. ?> 1234 <?phpheader("HTTP/1.1 301 Moved Permanently"); //this is a header for telling bots about the permanent redirectheader("Location: http://earlysandwich.com/new_page.html"); //this line tells the address of a new page for redirecting a user or bot.?> Author Posts Viewing 1 post (of 1 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In