Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » automatic redirect upon visitng homepage
Closed Thread
Old 07-21-2005, 01:14 PM   #1 (permalink)
 
Super Techie

Join Date: Mar 2005

Posts: 457

Rawan AbuSalman

Default automatic redirect upon visitng homepage

Hi,
Is there any code or something that automatically redirects visitors to a http address when they visit the homepage?

Thanx
Rawan AbuSalman is offline  
Old 07-21-2005, 01:21 PM   #2 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

You can put a re-direct in your META tag of the homepage

Code:
<meta http-equiv="REFRESH" content="0;url=http://whatever.com">
You can change the time before re-directing, by changing the number before the semicolon.

For example if you wanted to wait 5 secs before re-directing, the code would look like this.


Code:
<meta http-equiv="REFRESH" content="5;url=http://whatever.com">

__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
Old 07-21-2005, 01:45 PM   #3 (permalink)
 
Super Techie

Join Date: Mar 2005

Posts: 457

Rawan AbuSalman

Default

thanx...is there any other way? bc the page is loading and then redirecting (I put time 0) is there a faster way? or a way that directly (withought opening the page) it redirects?

Thanx again
__________________

Intel Core 2 Quad 2.4 Ghz
4 GB RAM
500 GB HD
512 MB ATI HD 2600 Pro
32" Samsung LCD
Windows Vista Ultimate
------------------------------------------------
HP Pavilion dv2000, Core 2 Duo 2.0 GHz
2 GB RAM
160 GB HD
DVD RW LightScribe
383 MB nVidia Graphics
1.3 MP Web Cam/ Fingerprint/ Bluetooth
Windows Vista Home Premium
Rawan AbuSalman is offline  
Old 07-21-2005, 02:37 PM   #4 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

Many times you can go into your domain name host and they have re-direct options.

Who hosts your domain name? (for example, godaddy, dreamhost, etc..)

Or you could just change the page you want re-directed from to a blank page with that in the meta tag so there's nothing to load.
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
Old 07-24-2005, 06:36 AM   #5 (permalink)
 
Newb Techie

Join Date: Jul 2005

Posts: 24

simplejohn

Arrow You can do this...

In the HEAD segment use this :

Quote:
<meta http-equiv="REFRESH" content="0;url=http://whatever.com">
In The HTML segment use this code that will automaticlly close the window after X seconds :

Quote:
<body onLoad="setTimeout('self.close();', X );">

____________
Simple John
The Slot Machine - The Best Casino Game Ever !
simplejohn is offline  
Old 07-24-2005, 09:24 PM   #6 (permalink)
Calzinger's Avatar
 
Beer

Join Date: Apr 2005

Location: New York

Posts: 565

Calzinger is on a distinguished road

Send a message via AIM to Calzinger
Default

The quickest way is to use javascript.
Code:
<script language="JavaScript1.4" type="text/javascript">
window.location = "http://www.google.com";
</script>
If you have PHP, use header()
Code:
<?php
header( "Location: http://www.google.com/" );
?>

__________________
Calzinger is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On