💡 /cgi-bin/

Venerable hosting providers may require CGIs[1] to be inside a /cgi-bin/ directory or refuse execution. However, this directory will not serve assets like css or image files. Since #Seppo wants to unpack files and store data next to itself, extra measures must be taken for those providers:

Redirect to /cgi-bin/

In order for the webserver to serve seppo.cgi from inside /cgi-bin/ but the assets from outside, a configuration is needed.

Put that as is into the .htaccess in your webroot (next to /cgi-bin/):

RewriteEngine On
# https://Seppo.Social/S1037
RewriteCond %{REQUEST_URI} !^/cgi-bin/
RewriteRule "seppo\.cgi" "/cgi-bin%{REQUEST_URI}" [passthrough,last]

Place seppo.cgi

#Seppo has to seize control over the directory it sits in. If this happens to be your webroot already having a configuration, you may want to put #Seppo into a subdirectory, e.g. https://example.com/subdirectory/seppo.cgi:

  1. put seppo.cgi into /cgi-bin/subdirectory/ and
  2. create an additional empty twin /subdirectory/ outside /cgi-bin/.

This way seppo.cgi knows, that it should pretend running inside /subdirectory/. And because #Seppo is reluctant to modify anything outside it's realm, you have to do that explicitly.

Footnotes

  1. RFC3875 The Common Gateway Interface (CGI), back^
  2. Apache Module mod_rewrite: RewriteRule Directive
  3. Redirecting and Remapping with mod_rewrite