How to forward a website to another url


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Apache Related Information
Top Level » General Usage

How to forward a website to another urlLast Modified: Jun 9, 2010, 8:06 pm
There are several ways to accomplish this task, but the simplest to understand is to use php.

To do this, you need to create the page that will do the forwarding.  This can be any page, as long as it ends in ".php".  If you are trying to redirect a domain, you'd create "index.php" inside the public_html directory.

Once you decide which page you will use, then create the file and enter the following text:

<?php
header("Location: http://whereyouwant.com/to/go.html");
?>

Where http://whereyouwant.com/to/go.html is the location that you want the page to forward to.  You can use local values, ie: /page.html, or full urls as in the above example (http://..etc.)




Another way to accomplish this is to use an .htaccess file in the public_html directory.  Sample contents:

Redirect 301 / http://whereyouwant.com/to/go.html

which will generate a similar result as the index.php Location redirect.

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST