How to Redirect a URL in PHP

104 18
    • 1). Open a new PHP page in the desired web design software. Alternately, you can right-click in a folder on your computer, select "New," then "Text Document," and rename the document with a ".php" extension.

    • 2). Paste the following code into the PHP document:

      "<?php

      header("Location: http://www.myredirectURL.com/");

      ?>"

      Note that you must remove the quotation marks found on the outside of this code.

    • 3). Replace the URL with the redirect URL of your choice.

    • 4). Save the PHP document. You may rename it, if desired, but keep the .php extension. You can upload the document to the website via an FTP uploading software or your web design software, if that feature is available.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.