Forum Moderators: phranque

Message Too Old, No Replies

Simple redirect

         

cwhitbeck

8:38 pm on Nov 8, 2004 (gmt 0)

10+ Year Member



I am using Apace on NetWare 6.5 and I am looking to do a simple redirect. What I need is when a user accessed the site:

i.e. mysite.com

is to direct them to a particular port:

i.e. mysite.com:5555

I tried a couple of things with no luck and just know it cannot be that hard. What am I missing - what is the simpleway to do this?

Thanks.

jdMorgan

10:27 pm on Nov 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cwhitbeck,

Welcome to WebmasterWorld!

Post you best effort and we'll have a look!

Jim

cwhitbeck

6:53 pm on Nov 10, 2004 (gmt 0)

10+ Year Member



Here it is. This script was already doing a redirect, but when I changed it to just go to a port something keeps putting a backslash at the end of the url.

I want: mysite.com:5555
I get: mysite.com/:5555

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<script language="JavaScript">
<!--

var sThisURL = unescape(':5555');
function doRedirect()
{
actualRedirect();
}
function actualRedirect()
{
setTimeout("top.location.href = sThisURL", 500 );
}

// -->
</script>
<script language="JavaScript1.1">
<!--

function actualRedirect()
{
top.location.replace(sThisURL);
}
if ("MSIE" == navigator.appName )
doRedirect();

// -->
</script>
</head>
<meta target="top" content="1;url=:5555" http-equiv="refresh">
<body marginwidth="0" leftmargin="0" bgcolor="#efeee9" topmargin="0" marginheight="0" onLoad="doRedirect()"></body>
</html>

Thanks for the help.

jdMorgan

7:05 pm on Nov 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That looks like JavaScript. If you are looking for a JavaScript solution, you'll get better responses in the JavaScript forum [webmasterworld.com].

If you want to use an Apache server-side mechanism to do the redirect, see Apache mod_alias -- specifically, the Redirect [httpd.apache.org] directives, or Apache mod_rewrite [httpd.apache.org]. More references are cited in our forum charter [webmasterworld.com].

Jim