davedave_au Posted March 28, 2007 Share Posted March 28, 2007 Hi, Last night I upgraded a Win2K server to run Apache 2.0.59 from 1.3 The problem is that the application running uses slashes instead of question marks and ampersands in the query string, without the use of mod_rewrite. A usual URL would be http://servername/path/script.php/key1/value1/key2/value2/keyN/valueN Apache 1.3 used to match "http://servername/path/script.php" and then the php application used the full URL ($_SERVER['PATH_INFO']) to reconstruct the query variables. I know this also works by default with Apache 2.2.4 on Linux. I cannot remember if I did anything special when I set up 1.3 on Win2K originally as it was about 5 years ago, but the configuration doesn't seem to show anything special. Any help would be greatly appreciated. Cheers, Dave Quote Link to comment Share on other sites More sharing options...
davedave_au Posted April 4, 2007 Author Share Posted April 4, 2007 Since no one has an answer, I've decided to solve it with mod_rewrite. Here's what I added to each virtual host RewriteEngine On RewriteRule ^(.*)\.php\/([^/]*)\/(.*)$ $1.php/$2=$3 RewriteRule ^(.*)\.php\/([^/]*)\/(.*)$ $1.php/$2&$3 [N] RewriteRule ^(.*)\.php\/(.*)$ $1.php?$2 [L] Explained: 1) Turn on the rewrite engine 2) If there's a slash immediately after the .php then replace the next slash with an equals sign. 3) If there's a slash immediately after the .php then replace the next slash with an ampersand. [N] means repeat from the start of the rewrites (until it doesn't match). 4) If there's a slash immediately after the .php then replace that slash with a ? Problem solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.