PDA

View Full Version : Redirect Web Page ...




Fender2112
Mar 18, 2004, 04:10 PM
How do you get a web page to redirect to another web site?

Thanks



varmit
Mar 18, 2004, 04:50 PM
no-ip.com, free stuff will give you a redirect.

wordmunger
Mar 18, 2004, 05:02 PM
Here is the Dreamweaver script for a Web page that automatically redirects to another page. You can change "http://www.myurl.com/" to the name of the site you want to load, and you're good go to go.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>

<body onLoad="MM_goToURL('parent','http://www.myurl.com');return document.MM_returnValue">
</body>
</html>

Blackheart
Mar 18, 2004, 05:05 PM
It's called a refresh, here're some instructions:

http://www.logiko.com/references/refresh.html

wordmunger
Mar 18, 2004, 05:08 PM
It's called a refresh, here're some instructions:

http://www.logiko.com/references/refresh.html

Wow! That's alot easier than my method. Can you set the number of seconds to 0?

Fender2112
Mar 18, 2004, 08:45 PM
It's called a refresh, here're some instructions:

http://www.logiko.com/references/refresh.html

Thanks much. That did the trick. And yes, the delay can be set to zero seconds. ;)

HexMonkey
Mar 18, 2004, 09:23 PM
There's also another method that can be used if you have an Apache server. You can upload a file called .htaccess to a directory and it can automatically handle redirecting. The advantage to it is that it can also redirect whole directories.

The basic structure of a redirect is as follows:
Redirect /old.html http://www.yourwebsite.com/new.html
where old.html is in the same directory as the .htaccess file and the full URL is the address of the new file.

To redirect whole directories, type:
Redirect /olddirectory/ http://www.yourwebsite.com/new.html
Whenever anyone tries to access anything in olddirectory, they will be redirected to the new URL.

If you're interested, more information can be found at
http://wsabstract.com/howto/htaccess.shtml
This page and the 'Redirects' link at the bottom should be sufficient.

One note, however, is that Finder prevents you from starting a file name with a dot. A workaround is to upload a file called 'htaccess' and rename it to '.htaccess' once on the server.