View Full Version : Strange redirect problem

04-02-2004, 09:24 AM
I have a strange redirect problem with my isp's server.
Every pages that redirect the browser to index.php page by header("Location ...") function return an error "Impossible view the page", but only if I use IE 5.x as browser and the pages are in my isp's server, in my local network I use a linux server with apache 2.0.48 and php 4.3.4 (like my isp's server) and I haven't any problem!
My isp doesn't allow me to view the log files so I can just imaging the server return me http status "302 Found" when I redirect it by header function and then it didn't find the location field so he return me the error, but I can't understand why it happens only when I use ie 5.x (if I use ie 6.x, netscape or opera I haven't any problem).
I hope you can understand because it's very difficult to explain this problem and my english it's not good at all.
Help me please!!!

thanks in advance

04-02-2004, 12:32 PM
Can you post a link to a page with such a redirect, so that we can see it ourselves?

Did you try this on different computers ? (I wouldn't like to waste my time on a problem that is caused by some browser-problem on your machine)

04-02-2004, 01:11 PM
yes, I tried with different pc and I have the same problem if I use ie 5.x, I tried to copy the pages on different server too but nothing change.

The link where I have the problem is http://www.etnetweb.it/elettronica/index.php , if you click on Offerta in the left box menu with ie 5.x you'll can see the error.
The code is very simple:
header("Location: http://".$_SERVER['HTTP_HOST']."/elettronica/".$location);
and if I use different browser it works.


04-02-2004, 01:48 PM
Hmm. it's not the redirect-code because when i enter http://www.etnetweb.it/elettronica/index.php?id=6 in the adressbar, and enter, then i get the same errorpage

i would first try to rename the page (copy and rename it to testfile.php), and then enter


and see what happens.

Could you else post the code that you use to check for and process the querystring (the id=6) ?

04-02-2004, 02:08 PM
I don't get the error if I use id=6, and the strange thing is that if I delete the right and left image scrolling box (now I've just deleted it) I don't get any error. If you try now you don't get the error.
I've already tried to rename the index.php page but I get the same error.

Anyway the code is:

function LoadPage($id)
$db = $this->db;
$q = "SELECT tipo_pagina FROM pagina WHERE id_pagina = $id";
$riga = $db->dbfetchassoc();
switch ($riga['tipo_pagina']) {
case 1: // Homepage
$location = "index.php";
case 2: // novitÓ
$location = "index.php?a=novita&p=$id";
case 3: // offerte
$location = "index.php?a=offerte&p=$id";
case 4: // promozioni
$location = "index.php?a=promozioni&p=$id";
case 5: // carrello
$location = "index.php?a=carrello&s=viewcart&p=$id";
case 9: // generica
$location = "index.php?a=content&p=$id";
header("Location: http://".$_SERVER['HTTP_HOST']."/elettronica/".$location);