Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Keep The TechnoWorldInc.com Community Clean: Read Guidelines Here.
Recent Updates
[May 13, 2025, 02:04:25 PM]

[May 13, 2025, 02:04:25 PM]

[May 13, 2025, 02:04:25 PM]

[May 13, 2025, 02:04:25 PM]

[April 12, 2025, 01:54:20 PM]

[April 12, 2025, 01:54:20 PM]

[April 12, 2025, 01:54:20 PM]

[April 12, 2025, 01:54:20 PM]

[March 12, 2025, 03:05:30 PM]

[March 12, 2025, 03:05:30 PM]

[March 12, 2025, 03:05:30 PM]

[March 12, 2025, 03:05:30 PM]

[January 03, 2025, 03:29:12 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Techno Articles » Webmaster » Web Development
 Different Ways To Redirect Visitors To Any URL You Want
Pages: [1]   Go Down
  Print  
Author Topic: Different Ways To Redirect Visitors To Any URL You Want  (Read 1206 times)
Stephen Taylor
TWI Hero
**********



Karma: 3
Offline Offline

Posts: 15522

unrealworld007
View Profile
Different Ways To Redirect Visitors To Any URL You Want
« Posted: July 28, 2007, 11:32:10 AM »


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.

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.062 seconds with 24 queries.