[Last Call] Learn how to a build a cloud-first strategyRegister Now


Execute a script each time a page is requested

Posted on 2004-11-28
Medium Priority
Last Modified: 2010-03-04
Is there a way to have a CGI script execute each time a page is requested on my web site? The CGI script doesn't have output - it is more of a maintenance script. I don't want to use SSI. I also don't have access to the main server configuration file. Is there a way to do this with perhaps .htaccess?

Thank you,
Question by:ericl1st
LVL 51

Accepted Solution

ahoffmann earned 1400 total points
ID: 12693766
write your CGI so that it reads the requested page and prints it on STDOUT, then add to .htaccess

RewriteCond %{REQUEST_URI}  ! ^/cgi-bin/your.cgi$
RewriteRule ^.*$    /cgi-bin/your.cgi

# keep in mind that your server needs to allow rewriting from within .htaccess

Author Comment

ID: 12746026

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month18 days, 14 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question