Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(.*).html$ root.php?%{QUERY_STRING}
At the php level I am relying on the REQUEST_URI parameter to identify the typed-in URL.
After testing this with few servers I run in a case where the rule didn't work. After investigation at the php level, I noticed the REQUEST_URI server parameter wasn't set to the originally typed url but instead to root.php. I then dumped the server parameters and noticed none of them contained a single reference to the original typed url in this case.
So I am suspecting that particular server must have a script to do a redirect on that rewriterule or something? (have limited server access so I cannot see the logs). Anyways to get around it I changed the rule to pass the requested page to cover such cases like:
RewriteRule ^(.*).html$ root.php?$1.html&%{QUERY_STRING}
And then added some additional code to process it at the php level and this works...
My question is, should I do all this extra processing, or should I rely on the host to have their scripts maintain the REQUEST_URI? Are they out of spec? Or should I change the .htaccess code?
AcceptPathInfo On
From your experience, is this something I should expect to see often, or is it a rare case? I am asking, as this is for a contribution for oscommerce where many people may use it and I want to have something as compatible as possible, with different server configuration settings.
In which case, you'd want to turn AcceptPathInfo Off as an experiment to see if thst affects your symptoms.
Or it could be some other problem...
> From your experience...
My experience is not all that great. I'm just a volunteer moderator here, answering a few questions that I can answer, and a few that I might be able to help with...
So, I don't know if the problem is common or not. I've seen several threads here on seemingly-related troubles, though. AcceptPathInfo is great if you need it and want it, but like several other Apache features such as MultiViews, its effects can be 'bad' if you don't want them, need them, or expect them.
Jim
I have no longer access to that server to test the AcceptPathInfo off case, but I can emulate and process the PATH_INFO parameter locally.
One other thing I tested was to conditionally do the extra processing if the REQUEST_URI points to the script that handles the html requests.
Again thanks for the information, if I find something else about it, I will post again to this thread.