Forum Moderators: phranque

Message Too Old, No Replies

Allowing web pages to only "SOMETIMES" be processed by a CGI.

Need help with CGI configuration in httpd.conf

         

rescueme

10:19 pm on Mar 29, 2011 (gmt 0)

10+ Year Member



Hello,

I am using a CGI on our Apache server to process a custom scripting language we use on virtually all of our web pages. This is what I've used to configure that CGI:

FastCgiExternalServer /Library/Tenon/WebServer/WebSites/.*(?<!\.(?:txt|ico|jpg|gif|pdf|htm))$ -re -host localhost:9008 -pass-header Authorization

The above statement in our httpd.conf file ensures all pages regardless of suffix get sent to the CGI.

Here's what I need help with...

I want to have web pages on our Apache server most of the time get served through the CGI as defined above but at certain times served as the raw web page file stored on the Apache server, not what gets interpreted by the CGI. So, in the end, I want to be able to do something like this...

www.MYWEBSITE.COM/samplepage

and have that processed by the CGI.

But then I also want to define something like...

NOCGI.MYWEBSITE.COM/samplepage

and set it up so it accesses the same exact file on the server, but does NOT get processed by the CGI.

I can use a different domain, an alias to refer to the page, whatever someone might suggest. Everything I've tried so far though (e.g. using MOD_ALIAS) causes the pages to still get processed by the CGI. Any suggestions?

Thanks,

- Jeff

jdMorgan

11:53 pm on Apr 6, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Defining a second virtual host (your "nocgi" subdomain as shown above) will allow you to disable cgi across that entire subdomain. You can set everything else up exactly the same -- share the same documentroot, etc.

For the sake of search ranking, I do suggest that you exclude search robots from indexing all or at least most of your nocgi subdomain. Otherwise, you will likely end up with duplicate-content problems in the search engines.

Jim