Redirect Web Page ...

Discussion in 'Mac Apps and Mac App Store' started by Fender2112, Mar 18, 2004.

  1. Fender2112 macrumors 6502a

    Fender2112

    Joined:
    Aug 11, 2002
    Location:
    Charlotte, NC
    #1
    How do you get a web page to redirect to another web site?

    Thanks
     
  2. varmit macrumors 68000

    varmit

    Joined:
    Aug 5, 2003
    #2
    a redirecting service

    no-ip.com, free stuff will give you a redirect.
     
  3. wordmunger macrumors 603

    wordmunger

    Joined:
    Sep 3, 2003
    Location:
    North Carolina
    #3
    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.

    Code:
    <!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>
     
  4. Blackheart macrumors 6502a

    Blackheart

    Joined:
    Mar 13, 2004
    Location:
    Seattle
  5. wordmunger macrumors 603

    wordmunger

    Joined:
    Sep 3, 2003
    Location:
    North Carolina
    #5
  6. Fender2112 thread starter macrumors 6502a

    Fender2112

    Joined:
    Aug 11, 2002
    Location:
    Charlotte, NC
    #6
  7. HexMonkey Administrator

    HexMonkey

    Staff Member

    Joined:
    Feb 5, 2004
    Location:
    New Zealand
    #7
    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.
     

Share This Page