Different Ways To Redirect Visitors To Any URL You Want Get the Trellian Seo Toolkit
Get our FREE SEO Guide
Subscribe to our newsletter to receive useful SEO tips, tricks, strategies, free ebooks that are available only to our subscribers and get this amazing SEO guide for free!

Your email is safe and will NEVER be shared with any other parties. And of course, you can unsubscribe at any time.

Name:
Email:
SEO Elite - #1 SEO Software

Who Else Wants To Finally Get A #1 Google Ranking In As Little As 7 Days... And Drive A Minimum Of 789 Unique Visitors To Your Websites Per Day?

Search engine spider simulator PHP script

With this PHP script, you can take a look at any website with the eyes of a search engine spider

Only $9.95
Coming soon ...


Self SEO Store  
SEO forum
Website templates
Flash templates
Best hosting reviews.
Free Internet & IT Magazines.
Articles archive

Submit your article

Register
Login

Search
XML news feeds
Free RSS news reader
Contact


AddThis Feed Button

Different Ways To Redirect Visitors To Any URL You Want

Posted by Heris Yunora on: 2006-08-20 20:51:21

Self SEO > Web Development Articles


URL redirection can be used for many purposes. Maybe you have just moved the content of a webpage to another webpage or domain and you want to redirect the frequent visitors of your website to the new webpage automatically. The knowledge of technique of redirecting URL is also useful if you want to shorten a long affiliate URL.



Below are several ways you can use to redirect visitors to any URL you want:

- Using Meta Tag
The tag for doing it is:

META http-equiv = "refresh" content = "0; URL = anydomain.com/destination.html"

Just put the tag above between the HEAD and /HEAD tags in a webpage. That way, when someone visits the webpage that contains the tag, he will be redirected to destination.html automatically. Don't forget to include the "http" protocol which has been omitted.

In order to find out how many visitors have been redirected you may try to replace the destination URL with a tracking URL.

- Using PHP code
In PHP, "Header" is a built-in function that is often used to accomplish this task. This function can be used to redirect visitors depending on a specific condition. For instance, you can use this function to redirect someone to a webpage after submitting his correct username and password.

Here is the code:

header("Location: anydomain.com/destination.php");

where destination.php is the destination URL.

Keep in mind that you have to save the file with .php extension in order to make it works.

- Using the redirect URL facility from your hosting service
Many web hosting services provide a facility that you can use to redirect pages of your site to any url you want. This way, you only have to fill the source and the destination URL in a blank form and hit the submit button.

- .htaccess
You can also use your .htaccess file for this purpose as long as the hosting company you are using allows you to access this file. The code below will redirect visitors from oldpage.html to newpage.html.

Redirect /directory/oldpage.html anydomain.com/directory/newpage.html

Just put the code in your .htaccess file.

Now, how if you want to display a URL without using .html or .php extension? First, put the Meta Tag or the PHP code above in a file and name it as index.html or index.php. Then create a subdomain and upload the file into it. When someone visits the subdomain, he will be redirected to the destination URL.

There are actually other techniques of redirecting URL with different advantages and disadvantages. For instance, with Domain Forwarding you can forward your domain name to a URL. Domain Masking that looks similar with Domain Forwarding can hide a URL with your own domain name so the real URL will not be displayed in the address bar of your visitor's browser.

Whatever technique of url redirect you intend to use, always choose the one that would best fit your needs.

About The Author:
Heris Yunora is the owner of http://www.unlimitedhostingplan.com, a website that contains information on shared hosting plan with unlimited database and other useful features.




Print this article    Tell a friend
User comments:

mtgcs2000 - Posted on: 2009-03-18 09:17:14

Hi Heris,

There's also an awesome piece of software I myself use to redirect URL's called Cloak N Rotate (www.cloaknrotate.com).

It allows you to redirect not only though the php way (using header) but through java script  for full address cloaking.

Plus it has tracking and can rotate between links (which I love )

Check it out.

- mtgcs2000

kayleigh.brand - Posted on: 2011-01-28 11:17:54

That’s quite a blog. Hah, well I will check back later. So you got my bookmark…
----------------------------------------------------------------------
internet marketing servicesseo servicesmba in finance

aymenbnr - Posted on: 2011-06-09 05:13:02

very nice article like usuak,very thoughtful info !!
freeads
Commission predators review
cheapest web hosting

jimb45 - Posted on: 2011-06-10 23:10:26

These are definitely great ways to get traffic to your website. You would be suprised how many people are doing this. Take advantage of these tools. central florida network company

cavoxe - Posted on: 2011-07-04 01:38:43

This is a great plan. I actually recommend a similar kind of routine when you get stuck at a certain strength level and want to be able to work through it. It really works well.
schildersbedrijf


cavoxe - Posted on: 2011-07-12 14:05:55

You got numerous positive points there. I made a search on the issue and found nearly all peoples will agree with your blog.
payday loans

cavoxe - Posted on: 2011-07-15 00:27:22

I simply came across your site and wished to say that I have really enjoyed reading your blog posts.I really like your way of expressing the opinions and sharing the information. I'am glad to see many positive points in this post, writing is simply amazing.
car insurance

cagenicolus - Posted on: 2011-08-01 11:57:11

I always like playing with .htaccess file because its a magic file and the key of many success.

Home Theater Systems
Audio Speakers

jenny198 - Posted on: 2011-09-08 12:40:28

Yep, .htaccess is cool, and if you can't do what you want, you may success by using the RewriteMap directive.

Assurance frontalier suisse
Graphiste

lilycollins - Posted on: 2011-09-24 07:10:38

This is a great plan. I actually recommend a similar kind of routine when you get stuck at a certain strength level and want to be able to work through it. It really works well.
Online Marketing:Internet Marketing:Web Development Services:Web Hosting Packages

darrensy - Posted on: 2011-10-04 12:56:48

I am into web developing, and I admit that I am newbie not have a full idea at all. and this certain information will really help me.

ipad case


Post New Comment

This site does not allow anonymous comments. Registered members can login to participate. Registration is free and takes only a few seconds