views:

59

answers:

4

I'm writting a HTTP server and when i tried the Serendipity PHP Blog i get requests from the browser like this one:

GET /serendipity_admin.php/templates/default/admin/pluginmanager.css HTTP/1.1

The "/serendipity_admin.php" file does exist so the "/serendipity_admin.php/templates/default/admin/pluginmanager.css" obviously must fail.

What should a webserver do when it discounters such a request?

I tried to just execute "/serendipity_admin.php" with the usual HTTP request headers (REQUEST_URI, PATH_INFO etc), but this does not seem to work so there is some more magick required. Can someone please explain.

+1  A: 

REQUEST_URI and PATH_INFO are not HTTP request headers. They are CGI environment variables.

A request for /serendipity_admin.php/templates/default/admin/pluginmanager.css results in /serendipity_admin.php being run with PATH_INFO as /templates/default/admin/pluginmanager.css

You should read the CGI specification.

Dave Hinton
A: 

The blog probably excepts that you are running a module that works like Apache's MultiView. Multiview causes Apache to look for serendipity_admin.php (among other things) if it cannot find the file with the exact path specified in the query.

hrnt
A: 

the web server will try to match the url from left to right.

since it finds the .php file, it will call it , the rest of the url will then be stored in the $_SERVER['PATH_INFO'] global PHP variable that is available for reading by the script.

Then the script can perform its logic depending on this variable.

dweeves
A: 

This looks like it's expecting you to use Apache's rewrite engine. Did it come with a .htaccess file? If so you'll need to set AllowOverride All in the VirtualHost or copy the contents of the file into the virtual host.

Neel