12 Useful HTML and Javascript Tricks (Part 3)
6. How to Automatically Redirect Your Visitor to Another URL
A redirection URL is sometimes also called a "fast META refresh". These
pages automatically redirect the visitor to whatever web page you specify.
You can use them to:
- Conceal affiliate links. Affiliate links are often very long and they
clearly brand you as an affiliate. A redirection URL will shorten the URL
to make it easier to both advertise and remember, and helps to minimize
lost commissions from people who will remove the affiliate part of your link.
- Shorten tracking URLs. Again, tracking URLs can be very long… a redirection
URL makes it clean and easy to remember.
- Prevent people from 'peeking' into directories. For example, you can create
an index.html file that redirects people back to the home page.
- Redirect visitors from a missing page to one that exists.
To create a redirection URL:
- Create a separate web page to be uploaded to your domain.
- Add a special HTML tag to tell the page where to redirect.
- Upload the page to your server.
The HTML code for a redirection URL looks like:
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://www.your_destination_URL.com/">
<TITLE></TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
Let's say you put this snippet of code on a page you call sell.html.
Whenever a visitor goes to your sell.html page, they're automatically redirected
to www.your_destination_URL.com.
7. How to Go To a Specific Point on a Page
Sometimes you want to create a web page with a lot of information on the one
page, separated into different sections. This is actually very easy to do. You
simply "name" each section, and then provide a link to it. For example, right
above the section you want to link to, add the following line:
<A NAME="section_name"></A>
Then wherever you want to link to it, you use:
<A HREF="#section_name">Your link text</A>
For example:
<A HREF="#tools">Click here to go to the TOOLS section</A>
<A HREF="#tips">Click here to go to the TIPS section</A>
<A NAME="tools"></A>
This is the TOOLS section.
<A NAME="tips"></A>
This is the TIPS section.
PREVIOUS: 12 Useful HTML and Javascript Tricks (Part 2)
NEXT: 12 Useful HTML and Javascript Tricks (Part 4)
© Copyright 2004, onlinebusinessbasics.com. All Rights Reserved.
Please contact us to request reprint permission.
|