Re: strange php url

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, April 24, 2006 1:58 am, nicolas figaro wrote:
> On my server, the building of some webpages with url like the one
> below
> produces a loop
> and crashes the server.
> (http://myurl.mydomain/path/index.php/path/index.php).

Odds are VERY GOOD that you have some kind of bad regex in your
httpd.conf which sends Apache into an infinite loop in mod_rewrite.

You will need to turn on mod_rewrite debugging and error logging and
crash the server again to find out what is happening.

> As I never heard about the PATH_INFO before, I'm not sure the site
> uses
> this value.
> (I'll check the code to be sure).

[james stewart voice on]
One of the advantages of using $_SERVER['PATH_INFO'] in PHP instead of
mod_rewrite is that it's a lot harder to screw things up so
spectacularly.
[james stewart voice off]

> If I can make sure the PATH_INFO isn't used anywhere in the code, is
> there a way to
> change the config in order to generate a 404 for each url with a not
> null PATH_INFO ?

I don't really understand this bit, but you should be able to do
something like this:

<?php
  if (is_bad($_SERVER['PATH_INFO'])){
    header("Location: http://example.com/nonexistent.htm";);
  }
?>

This assumes that you can discern "bad" PATH_INFO from "good"
PATH_INFO and that nonexistent.htm does not actually exist -- or that
could exist and be a pretty page explaining that the URL they want
isn't there, if you don't want a true 404

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux