.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Programming (http://forums.bots-united.com/forumdisplay.php?f=25)
-   -   Auto-moving to another webpage (http://forums.bots-united.com/showthread.php?t=63)

stefanhendriks 25-12-2003 14:38

Auto-moving to another webpage
 
When the new website is up at BU, i'd like to get my users moved instantly to this one when they go to my old site. Can someone post me the code for this?

Pierre-Marie Baty 25-12-2003 21:25

Re: Auto-moving to another webpage
 
this is JavaScript... log out and in the forums, or do a forum search, so as to have displayed that "redirecting... click here if you do not wish to wait" page, then hit stop, and look at the page's HTML source... :)

@$3.1415rin 25-12-2003 21:47

Re: Auto-moving to another webpage
 
lol, that's the way I do it too when I need such code :D

stefanhendriks 26-12-2003 13:09

Re: Auto-moving to another webpage
 
Code:

<script language="JavaScript">
<!--
if( -1 == location.href.
          toLowerCase().
          indexOf('www.bots-united.com') )
{
  location.href = 'http://www.bots-united.com';
}
// -->
</script>

I figured this code works instantly for redirecting. It does not allow the users to read that they are redirecting. I also read somewhere in a book that you can do it with pure html though.

Anyway, i found this on the internet using mighty google ;) the login->view source thingy gave me to much crap :)

Pierre-Marie Baty 27-12-2003 13:23

Re: Auto-moving to another webpage
 
<meta http-equiv="Refresh" content="1; URL=http://realbot.bots-united.com">

:)

[edited: don't forget the http:// else it won't work]

Austin 30-12-2003 01:35

Re: Auto-moving to another webpage
 
If anyone cares,

Using ASP,
<%@ language="vbscript"%>
<%
Response.Redirect"'http://www.bots-united.com")
%>

Soon, I won't care either. I am going BACK to Unix/ Linux totally and leaving the
windows crap behind.

raiden 02-01-2004 01:28

Re: Auto-moving to another webpage
 
i think the meta tag is the best way (yes i use it, so i say work with metatags :>)

Austin 06-01-2004 11:10

Re: Auto-moving to another webpage
 
Quote:

Originally Posted by raiden
i think the meta tag is the best way (yes i use it, so i say work with metatags :>)

Yes, the meta tag is clean, BUT be aware of WHERE the redirect is hapenning,
at the server - BEFORE the browser knows about it
or
At the browser (client).

At the browser has a number of problems, with caching, with not wanting to do the redirect, with 2rd party software like add removal software that doesn't allow redirects, and on and on and on....

Fierce Recon 11-01-2004 05:59

Re: Auto-moving to another webpage
 
a php version:

PHP Code:

header("Location: http://www.php.net");
die(); 

but you can't write anything on the page (even a linebreak) or it'll give you a very nasty error.

dav 14-01-2004 20:27

Re: Auto-moving to another webpage
 
also, last i looked, you don't even technically need the die() there - just make sure the header() is before any output on the page (as headers are sent before content, and thus any content locks in the current headers)


All times are GMT +2. The time now is 03:28.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.