Knowledgebase
Search:     Advanced search
Browse by category:
Contact Us

Header Redirect

Views: 53
Votes: 0
I would like to redirect my website to another website (domain, location) How would I do that?
 
Redirecting your domain couldn’t be simpler. You can do it two ways. We will explain both methods here.
 
Method One:
 
The number one method is what you would do at your registrar. You would login to your registrar account and forward your domain to a new location (website). Please beware that not all registrars support domain forwarding.
 
Method Two:
 
The second is what is known as a “Header Forward” is a simple PHP file called index.php in your main /public_html/ directory. Please see the code below for it:
 
<?php

header("Location: http://www.example.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;

?>
 
How to get the file in place:
 
  1. Open notepad copy the above code
  2. Replace “http://www.example.com/” with your domain
  3. Save the file as index.php
  4. Upload the file using your FTP Software to the /public_html/ directory.
  5. Visit your site and it will take you to the site you are redirecting to.
Others in this Category
document What are some basic software paths?
document How do I change File Permissions?
document What is SSI (Server side includes) and how can I use it?
document Where do I place CGI scripts?
document What is the path to sendmail?
document What is the path to my home directory?
document What are valid file extensions I can use for PHP scripts?
document What is PHP and how do I use it?
document How do I provide streaming - Audio / Video ?
document How do I edit the text of my web page?
document Can I run PHP scripts anywhere on my site?
document What are some basic SSI tags/features?
document What is the path to perl?
document Which php modules are installed on servers?
document How do I make SSI (Server Side Includes) work in .html?
document Backing up MYSQL Via Cron
document .htaccess domain.com to www.domain.com redirect
document Where can I download free PHP scripts?
document 500 Internal Error
document What do the different HTTP Status Codes like 200, 304, 404, 401, 403 mean?



RSS