I've got a cgi (stealth.cgi) that needs to take most URLs and funnel them through the CGI. (I think I can filter out the URL's that I don't want there)
Internally to the CGI, I use the pathinfo portion to dictate what happens.
so stealth.cgi/something
should redirect to stealth.cgi and pathinfo gets handed to the CGI.
I had this working on my own system but had a separate directory for cgi-bin and all was good.
Now I'm faced with my CGI being in the same directory as my HTML directory... something I hadn't planned on....
I've tried many different incantations of the following, but most of them end up in an infinite loop.
domain.com/stealth.cgi/stealth.cgi/stealth.cgi/stealth.cgi
- Code: Select all
DirectoryIndex stealth.cgi
Options ExecCGI Indexes FollowSymLinks
AddHandler cgi-script cgi pl
ReWriteOptions MaxRedirects=2
ReWriteEngine on
ReWriteBase /
#ReWriteCond %{REQUEST_URI} !\.css$
#ReWriteCond %{REQUEST_URI} !\.png$
#ReWriteCond %{REQUEST_URI} !\.jpg$
#ReWriteCond %{REQUEST_URI} !\.jpeg$
#ReWriteCond %{REQUEST_URI} !\.gif$
#ReWriteCond %{REQUEST_URI} !\.html$
#ReWriteCond %{REQUEST_URI} !robots.txt$
#ReWriteRule ^(one)$ /stealth.cgi/one [L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
ReWriteRule ^(.*)$ /stealth.cgi/$1 [NS,R,L]
As a side note, my previous setup would not display the CGI in the URL , so I'd have www.domain.com and NOT www.domain.com/stealth.cgi....
What options do I have here?
I'm saavy, but never gotten in depth with mod_rewrites, and am feeling a bit out of my league here.
Any direction of a good approach would be very much appreciated.
Thanks
Matt