Website Redirecting PHP Version
Here is another quick way to redirect websites but this time we’ll do it using PHP. I like to use this technique when forwarding domains to a different directory.
- Open up your favorite web editor.
- Make a new PHP file.
I’m going to call mine index.php but you can name it whatever you want. - Copy/Paste the following snippet of code: <?php header(“Location:http://YOUR URL”); ?>
My Example: <?php header(“Location:http://esc.eugenechoe.com/main/”); ?> - Put in the URL you want to redirect to where it says “YOUR URL”.
- Save your file and upload it to the directory of your choosing.
- I uploaded my index.php file to the root directory of esc.eugenechoe.com so that it redirects to esc.eugenechoe.com/main where the real website is located.
Leave a Reply
Want to join the discussion?Feel free to contribute!