Forum Moderators: phranque
First off, we use a CGI program called "NetCloakEnabler" to handle most of our pages. Someone gave me the following line to add to our httpd.conf file:
FastCgiExternalServer /Library/Tenon/WebServer/WebSites/* -re -host localhost:9008 -pass-header Authorization
The above line, successfully passes all web page requests to the NetCloakEnabler program, which is indeed what I wanted. The "trick" here is that I didn't want to just pass pages ending with a certain suffix (such as, say .nclk) but instead also wanted pages without any suffix at all to be handled by this CGI as well, which is why the * has no suffix at all after it.
For example, the NetCloak Enabler not only handles: www.SomeSite.com/webpage.nclk
It ALSO must handle web pages like this: www.SomeSite.com/webpage
(in the case above, "webpage" is not a directory, it itself is a page)
Well, the line shown above does work, HOWEVER, that line causes EVERYTHING to go to NetCloak, including graphics. I DON'T want some files going to NetCloak such as: .jpg, .gif, .ico, .txt, ETC.
At this point, while I can program web pages, javascript, etc., I know nothing about Unix or Apache, so all I can do is basically COPY/PASTE what people suggest. If you can offer any hints about how I can change this line (or add additional lines) so that only certain pages are sent to NetCloak, please let me know what to do:
FastCgiExternalServer /Library/Tenon/WebServer/WebSites/* -re -host localhost:9008 -pass-header Authorization
I know how to modify this so only certain suffixes are sent, the trick I need help with is to allow only certain suffixes, but not others, while ALSO allowing pages without any suffix at all to go to NetCloak.
Any ideas? Thank you.
If your path does not contain any additional periods, you could use a positive list like
/Library/Tenon/WebServer/WebSites/(?>[^.]*)(?:\.(?:nclk¦bar))?$ otherwise a negative lookbehind.
/Library/Tenon/WebServer/WebSites/.*(?<!\.(?:jpg¦gif))$ The PCRE manpage [perldoc.perl.org] has details about the syntax.
Replace ¦ with solid ones from your keyboard.