Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache config setting - file control 1

Status
Not open for further replies.

MSRez

Programmer
Dec 22, 2004
57
EU
I have a PHP script running on someone else's Apache server which accesses variables in the format of "page.php/var1/var2" (doesn't use mod_rewrite).

On most servers this set up is fine as Apache just interprets that it must display page.php and effectively ignores "/var1/var2" that follows. However, on the server in question, Apache instead treats page.php/var1/var2 as if it is a different file/directory in itself. The problem I have is I don't know what config setting controls this - have looked at FollowSymLinks but didn't seem to be able to resolve it with that.

If you need me to explain things in more detail, please ask. Thanks.
 
Wait, I've been using Apache for a while with no particular configuration control and I'm able to do this:


Someone in Apache documentation land I read that Apache will "run" the rightmost script it can find in real file space...

Well, I'm pretty sure I do it without configuration. Yeah, I'm pretty sure. Sorry, no caffeine yet.

Sorry this doesn't help, but I'll second that Apache should do this out of the box.

D.E.R. Management - IT Project Management Consulting
 
Thanks for your reply. I will try to explain a little bit clearer.

The URL format I am trying to achieve is This works fine on all other servers I've tried since it recognises that page.php is a file and not a directory and the PHP script handles the rest. If it was "page" instead of "page.php" I would expect it to treat it as a directory.

I have an example of it working correctly is here:

On the server that page is running on I have no problems but an Apache setting on the other server must be causing it to not work correctly.
 
I don't think this is an apache issue but rather a php configuration issue. I'm thinking it has something to do along the lines of $HTTP_GET_VARS and $HTTP_POST_VARS. In most cases this is because register_globals is set to off by default. Edit php.ini to set register_globals = on but be advised this is not the prefered way of doing things. You may want to update your code.

 
After much searching I have finally found the answer. The Apache setting preventing this from working is AcceptPathInfo.

Adding "AcceptPathInfo On" to .htaccess has fixed the problem. I hope this helps others with the same problem.
 
I read up on AcceptPathInfo at apache.org so now I understand your problem a bit better. I was way off in another direction. I don't know when anybody would actually use something like that but it is kind of neat to know. I gave you a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top