View Single Post
  #1   (View Single Post)  
Old 7th May 2008
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 377
Default mod_rewrite and path_info problem

Apache version 1.3 and htaccess only.

I have a small test executable, written in C not script, that works in lighttpd and Apache. However, in Apache, I don't get PATH_INFO data. PATH_INFO prints NULL, PATH_TRANSLATED is empty and SCRIPT_NAME prints the path to my script (which is correct).

Output:
PATH_INFO=(null)
SCRIPT_NAME=/cgi-bin/b
PATH_TRANSLATED=
SCRIPT_URL=(null)
IP=71.85.241.27

I'm using mod_rewrite like this:

RewriteEngine on
RewriteRule ^/?([a-z/-]+)$ cgi-bin/my_app [L]

I guess it's getting rewritten before Apache handles the info but don't know. In any case, I need to be able to extract everything after the URL, as in example.com/page1/info . I prefer, at least, to get page1/info from somewhere.

I question whether I should use mod_rewrite at all and should use some other method or mod. The web app this will run can either handle all requests by itself, or I can divide it up to handle individual requests, such as example.com/page1, example.com/page2, etc.

It's been so long since I've touched Apache that I'm sure I'm doing something wrong.
Reply With Quote