From 1c22a86e073d57c4b35ac5b7ffea07aa541141c4 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sat, 10 Jan 2015 20:14:14 +0200 Subject: Make it possible to use apache rewrite rules to create nice cgi urls Example: configure with options: --without-script-suffix --without-script-dir, and add the following to the Apache virtual host configuration: RewriteEngine on RewriteRule ^/dict(.*) /cgi-bin/dict.cgi$1 [H=cgi-script] RewriteRule ^/nea(.*) /cgi-bin/nea.cgi$1 [H=cgi-script] RewriteRule ^/conj(.*) /cgi-bin/conj.cgi$1 [H=cgi-script] All cgi's will then be referred to directly, as in: http://ellinika/dict?lang=pl. * configure.ac (REAL_SCRIPT_SUFFIX): New subst var New options --with-script-suffix, --with-script-dir * src/cgi-bin/.gitignore: Remove cgi * src/cgi-bin/Makefile.am: Rename installed scm's in place * src/ellinika/cgi.scm4 (cgi-program-name): Suffix can be empty. * xml/lingua.conf.in: =SCRIPT_SUFFIX= always begins with dot --- src/ellinika/cgi.scm4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ellinika/cgi.scm4') diff --git a/src/ellinika/cgi.scm4 b/src/ellinika/cgi.scm4 index 51f9570..28adea1 100644 --- a/src/ellinika/cgi.scm4 +++ b/src/ellinika/cgi.scm4 @@ -127,7 +127,7 @@ ifelse(IFACE,[CGI],[ (define-public (cgi-program-name prog) (string-append (substring cgi-script-name 0 (string-rindex cgi-script-name #\/)) "/" - prog ".SCRIPT_SUFFIX")) + prog ifelse(SCRIPT_SUFFIX,,,"SCRIPT_SUFFIX"))) (define-public (expand-template explist template) "(expand-template EXPLIST TEMPLATE) -- cgit v1.2.1