[Home]How do I redirect someone to my new page

HomePage | RecentChanges | Preferences | Newbie Help

How do I redirect someone to my new page?
How do I automatically redirect my users to a new webpage?


Comments --


Arjun Ray says --

The code is in your server configuration. If your server is Apache, for instance, you can use the RedirectPermanent or RedirectTemp directives in an .htaccess file:

 http://httpd.apache.org/docs/mod/mod_alias.html#redirect
 http://httpd.apache.org/docs/mod/mod_alias.html#redirectmatch
 http://httpd.apache.org/docs/mod/mod_alias.html#redirectperm
 http://httpd.apache.org/docs/mod/mod_alias.html#redirecttemp

On Mon, 05 Mar 2001 08:39:04 -0600, Craig Keefner <keefner@visi.com> wrote on comp.infosystems.www.authoring.html:

The tag you are thinking of goes in a page and is

<html>
<head>
<META http-equiv="refresh" content="3; URL=http://www.your new site.com">
</head>
<body>
Please adjust your bookmarks. We'll try and push you to new site in 3 seconds. 
</body>
</html>

The correct/preferred way is to configure your old server to redirect the users. With Apache servers (which are mostly referenced here) there are commands to do that. Netscape and IIS are bit different. The above will work with limitations and can be used to buy time till you discern the preferred (which others have directed you to FAQs)


I would also include the new URL in the BODY of the document, as a simple hyperlink. If the META refresh fails, the user can still click on that link to get to the new site.

Greg Hewitt-Long says --

Arun alluded to the most efficient method, and provided links to tutorials - an example or two might make principle a little easier to understand...

An example would be when you want to redirect oldpage.html to newpage.html using .htaccess - the entry would look like this:

redirect 301 /oldpage.html http://www.yourdomain.com/newpage.html


You can create redirects in your site to embedded links using a quick and dirty .htaccess entry - this principle can be used to email long links, or talk clients/visitors through a short link to end up at a longer one - example:

Directing potential customers to the frontpage and following a link to the domain registration of our .htaccess company proved that it's always possible to mess up something you think is absolutely as simple as can be.

E-Mailing a link to the page failed on a couple of customers because the URL was long - causing their email client to wrap the URL and break it.

However, entering the following line into .htaccess

redirect 301 /domains https://www.aaabusinesshosting.com/domain_name_registration/domain_registration.shtml/

and then emailing the short link: http://aaabusinesshosting.com/domains/ to the client, to our secure server domain registration link. This MAY be how the likes of tinyURL.com work - although I suspect a more elegant solution than an ever growing .htaccess file (but you never know...).


HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited July 5, 2003 11:44 pm (diff)
Search:

This FAQ is happily hosted by Betadome Digital Media