1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Redirect Scripts HELP!

Discussion in 'Software Development' started by motofabio, Apr 16, 2004.

Thread Status:
Not open for further replies.
  1. motofabio

    motofabio Thread Starter

    Joined:
    Apr 29, 2003
    Messages:
    47
    Hello. I was told by my hosting company that they cannot redirect multiple URLS to subfolders on my shared server. But that the same effect could be achieved by using a redirect script in the header of my index page. Of course, they couldn't give me an example of that.

    Does anyone know what the code is or know of a index.htm that I can view the source on to see it?

    Thanks in advance,

    fabio
     
  2. mussavcom

    mussavcom

    Joined:
    Mar 28, 2004
    Messages:
    51
    A meta tag in between the <head> and </head> tags would work:

    <META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://yoursite.com/subfolder/index.html">

    The number 0 is how many seconds it waits before refreshing; this would refresh instantly, or you could set it to 1, 2, etc. seconds.

    The other method is JavaScript. Change the <body> tag to:

    <body onLoad="redirect();">

    Then, put the following in the head section:

    <script language="JavaScript">
    function redirect()
    {
    window.location.href = "http://yoursite.com/subfolder/index.html";
    }
    </script>


    Either method would work.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/221002

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice