Professional Web Applications Themes

Location header - slow redirect - PHP Development

I'm using the following short script to redirect users to another page on my site (php 4.3.2, Apache 2.0.47). <?php $goLang='en'; header("Location: http://" . $_SERVER['HTTP_HOST'] . "/" . $goLang . "/"); exit; ?> I'm having a problem where it takes up to 15 seconds for the redirect page to load, but for other redirects on the site programmed in a similar way using php and the location header the page loads straight away. I'm a bit perplexed and would appreciate some suggestions. Thanks Phil...

  1. #1

    Default Location header - slow redirect

    I'm using the following short script to redirect users to another page
    on my site (php 4.3.2, Apache 2.0.47).

    <?php
    $goLang='en';
    header("Location: http://" . $_SERVER['HTTP_HOST'] . "/" . $goLang . "/");
    exit;
    ?>

    I'm having a problem where it takes up to 15 seconds for the redirect
    page to load, but for other redirects on the site programmed in a
    similar way using php and the location header the page loads straight away.

    I'm a bit perplexed and would appreciate some suggestions.
    Thanks
    Phil

    Admin Guest

  2. #2

    Default Re: [PHP] Location header - slow redirect

    try putting this after the header:

    echo "<HTML></HTML>";

    It forces the redirect to take place immediately (in most cases!).

    HTH

    On Wednesday 30 Jul 2003 11:53 am, admin wrote:
    > I'm using the following short script to redirect users to another page
    > on my site (php 4.3.2, Apache 2.0.47).
    >
    > <?php
    > $goLang='en';
    > header("Location: http://" . $_SERVER['HTTP_HOST'] . "/" . $goLang . "/");
    > exit;
    > ?>
    >
    > I'm having a problem where it takes up to 15 seconds for the redirect
    > page to load, but for other redirects on the site programmed in a
    > similar way using php and the location header the page loads straight away.
    >
    > I'm a bit perplexed and would appreciate some suggestions.
    > Thanks
    > Phil
    Nicholas Robinson Guest

  3. #3

    Default Re: [PHP] Location header - slow redirect

    Excellent, that does the trick.
    Thank you
    Phil

    On Mercoledž, lug 30, 2003, at 13:56 Europe/Rome, Nicholas Robinson
    wrote:
    > try putting this after the header:
    >
    > echo "<HTML></HTML>";
    >
    > It forces the redirect to take place immediately (in most cases!).
    >
    > HTH
    >
    > On Wednesday 30 Jul 2003 11:53 am, admin wrote:
    >> I'm using the following short script to redirect users to another page
    >> on my site (php 4.3.2, Apache 2.0.47).
    >>
    >> <?php
    >> $goLang='en';
    >> header("Location: http://" . $_SERVER['HTTP_HOST'] . "/" . $goLang .
    >> "/");
    >> exit;
    >> ?>
    >>
    >> I'm having a problem where it takes up to 15 seconds for the redirect
    >> page to load, but for other redirects on the site programmed in a
    >> similar way using php and the location header the page loads straight
    >> away.
    >>
    >> I'm a bit perplexed and would appreciate some suggestions.
    >> Thanks
    >> Phil
    >
    Phill Ashworth Guest

  4. #4

    Thumbs up Re: Location header - slow redirect

    Funciono Estamos Agradecidos.

    Nuestro problema fue lentitud en Firefox y en Chrome funciona correctamente.
    Unregistered Guest

Similar Threads

  1. [PHP] Header won't redirect
    By Jay Blanchard in forum PHP Development
    Replies: 3
    Last Post: September 19th, 08:26 PM
  2. [PHP] Header won't redirect
    By Jay Blanchard in forum PHP Development
    Replies: 3
    Last Post: September 19th, 05:08 PM
  3. Header won't redirect
    By Jonathan Duncan in forum PHP Development
    Replies: 4
    Last Post: September 19th, 04:01 PM
  4. [PHP] Header won't redirect
    By Jay Blanchard in forum PHP Development
    Replies: 0
    Last Post: September 19th, 01:17 PM
  5. Replies: 2
    Last Post: July 26th, 10:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139