Home
 

Customer Support

Search for keywords:

Browse by category:

How do I redirect traffic to another web page?

There are multitudes of ways to redirect web traffic. Here are four ways that work well:
  • HTML Meta Rrefresh:
    <meta http-equiv="refresh" content="0;url=http://modwest.com"/>
    This technique will work in any HTML, and causes the browser to instantly load the site specified after url=. To introduce a delay, increase the number after content=; Typing a 5 would mean 5 seconds before redirection.
  • Apache Redirect:
    You can type the following into a .htaccess file to send anything matching the first URI value to the second URL:
    Redirect /path-to-redirect http://modwest.com/
    This would reroute, for example, http://yoursite.com/path-to-redirect/index.php to http://modwest.com
  • PHP HTTP Header Redirect
    In any PHP script, before actual HTML output has started, you can use the header() function to insert a location header, instantly redirecting the browser:
    header('Location: http://modwest.com/')
  • Apache mod_rewrite Redirect
    This is the most difficult but powerful of these four methods. In the example below, with code living in a .htaccess file, any traffic will redirect to modwest.com. You imagination and the documentation above can produce other endless possibilities.
    RewriteEngine On
    RewriteRule .* http://modwest.com [R]

User-Contributed Notes

add a note
steffi -at- evolv.com
02-Jun-2008 10:07
For search engine friendly 301 redirects where you want to redirect a
previous website or a non-www site to a www site (in order to avoid
search engines from ranking them as two duplicate sites), see the
following webpage: http://www.webconfs.com/how-to-redirect-a-webpage.php

add a note

Related Questions:


Why does my website just say "Error 403 Forbidden"?

How do I protect a directory with .htaccess?

How can I show a default page other than index.html?

How do I stop people from getting directory listings when I dont have an index page?

What do the different HTTP Status Codes like 200, 304, 404, 401, 403 mean?

What options are configured with Apache and what can I do with .htaccess files?

How do I protect a directory with mod_auth_mysql?

How do I stop other websites from using my bandwidth while they steal images, flash, etc. from my site?

Which Apache modules are installed?

How do I make my own Error Documents to replace the default ones like 404 Not Found?

How can I make apache recognize different MIME types?

The webservers' Gzip compression is messing up my XML or Flash files for Netscape 4 browsers. How do I turn off compression?

How do I get different character sets to display correctly?

What webserver do you run?

Will I have access to raw logfiles?

I created a symbolic link, and now I am getting a 404 errors.

My mod_rewrite rules make my website stop loading.

How do I stop the server from automatically correcting spelling mistakes in URLs or offering multiple choices for documents?

Why am I getting a 412 Precondition Failed from a website?

How do I protect my website from comment spam?

How do I enforce the use of SSL on my website?

Browse Categories:

Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales


Tiny Modwest Logo         Copyright 2000-2008 by Modwest, Inc.          About Us    |    Blog    |    Jobs    |    Web Design    |    Contact Us