Hello people I am using Apache 2.0.55 Web server as a service on top of Windows machine I am using PHP as a server side script During debugging my application locally on 'localhost' I performed some 301 redirects on some pages. Now I cannot make Apache forget about these redirects For example I used PHP to peform 301 redirect from http://localhost/test.php?p=1 to http://localhost/test.php I now regret this, but everytime I go to http://localhost/test.php?p=1, I am being taken to http://localhost/test.php Since this was done locally, I hope there is a way to tell Apache to forget about this changes Am I right? Any help would be appreciated regards
Hi, What did you do to perform these 301 redirects ? DId you do it within the PHP programs or did you use .htaccess ? Jean-Luc
I used the following syntax to perform the 301 redirect: header("HTTP/1.1 301 Moved Permanently"); header("Location: http://localhost/test.php"); exit; PHP: I got to that page using the URL: http://localhost/test.php?p=1 and that caused it to be redirected to http://localhost/test.php
take out that 301 redirect you dont need it, instead use a modrewrite within you .htacess to accomplish what you need
There are 2 problems with that solution: 1) It doesn't solve my problem. I still want to be able to go to http://localhost/test.php?p=1 without losing my parameter 2) I cannot let Apache do this redirect as it should only happen upon very specific conditions that I can only verify in PHP any other suggestions?
if($p==""){ header("HTTP/1.1 301 Moved Permanently"); header("Location: http://localhost/test.php"); exit; } PHP:
Maybe I am not being clear. I don't want to know whether I need to redirect or not I don't want to know how I can perform redirect in other means, or how can I use logic to decide whether to perform redirect I already performed the permanent (301) redirect. It is done already - Take it as a fact I want to revert what I did and to cause apache to forget that it was ever done
This does not make sense to me. Apache will not remember what you put in a PHP program yesterday, if you change it today. I am still not understanding what you try to achieve. Jean-Luc
Just delete the redirect code from the page and it will stop working. Maybe you need to refresh the page to get rid of the cached copyas well.