Beginner question

Discussion in 'HTML' started by John, Oct 18, 2003.

  1. John

    John Guest

    Hi, if someone goes to a particular page on my web site, how can I make it
    so another page is automatically loaded instead of the original page?

    All the best, John.
    John, Oct 18, 2003
    #1
    1. Advertising

  2. John wrote:

    > Hi, if someone goes to a particular page on my web site, how can I make it
    > so another page is automatically loaded instead of the original page?


    Depends. Do you have server-side scripting? If not, then something like
    this may be required:

    =================================================================
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd"> <html>
    <head>
    <script>
    window.location.replace("http://www.example.org/page2.html");
    </script>
    <meta http-equiv="Refresh"
    content="0;url=http://www.example.org/page2.html">
    <title>Redirection</title>
    </head>
    <body>
    <h1>Redirection</h1>
    <p>Your browser should have been redirected automatically, but if you
    are reading this, then it hasn't worked. Oh well, here is <a
    href="http://www.example.org/page2.html">the page I would like you to
    visit</a>.</p>
    </body>
    </html>
    =================================================================

    This uses three techniques to redirect the user. The <meta> tag should be
    99% reliable, but for those browsers that don't support it, we add a basic
    text link.

    We add JavaScript, because it tends to redirect straight away, whereas
    with the <meta> tag, browsers tend to wait for the entire page to load
    before redirection.

    Of course, none of this is as good as using proper HTTP headers, so if you
    have some kind of server-side scripting capabilities, let us know,
    including which scripting languages your server supports.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
    playing://lou_reed/nyc_man_disc_2/09_perfect_day.ogg
    Toby A Inkster, Oct 18, 2003
    #2
    1. Advertising

  3. John wrote:
    > Hi, if someone goes to a particular page on my web site, how can I make it
    > so another page is automatically loaded instead of the original page?


    If you're using Apache and have .htaccess rights, you can use that. To
    redirect from foo.html to bar.html for instance, create a file named
    ..htaccess with this in it:

    redirect foo.html bar.html
    Leif K-Brooks, Oct 18, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerker Hammarberg

    Beginner question: What trigs processes

    Jerker Hammarberg, Jul 17, 2003, in forum: VHDL
    Replies:
    16
    Views:
    1,606
    Mike Treseler
    Jul 22, 2003
  2. smu
    Replies:
    3
    Views:
    2,627
    shobhit24
    Jun 28, 2006
  3. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    No Class at ALL!!! beginner/beginner question

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    557
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
    Feb 3, 2005
  4. Rensjuh
    Replies:
    7
    Views:
    947
    Mabden
    Sep 2, 2004
  5. william nelson

    Beginner's Beginner

    william nelson, Apr 11, 2011, in forum: Ruby
    Replies:
    7
    Views:
    199
    7stud --
    Apr 12, 2011
Loading...

Share This Page