diff options
author | Adam Spragg <adam@spra.gg> | 2018-07-26 15:48:55 +0100 |
---|---|---|
committer | Adam Spragg <adam@spra.gg> | 2018-07-26 15:48:55 +0100 |
commit | a5de4e1e1f7fbf10d234957c28a8358c2fb9768c (patch) | |
tree | 7e6125b39bfd8369ac68b797c5317e1b5dc1225b /apache2.conf | |
parent | f80f775dfbe12cf6b95bda38b73f5dc37327d7fa (diff) |
Host cgit directories under .../cgit.cgi/
Rather than .../cgit/
This allows for a general redirect that can be used in multiple places
in the website in future, without it getting confused over the
/style/cgit/ directory.
Put redirects in to make old links/bookmarks still work. Not as if
anyone has made bookmarks already, but it's a good habit to get into.
Diffstat (limited to 'apache2.conf')
-rw-r--r-- | apache2.conf | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apache2.conf b/apache2.conf index 030bac1..12a4e24 100644 --- a/apache2.conf +++ b/apache2.conf @@ -183,15 +183,18 @@ # Enable user-dirs UserDir public_html - # Enable cgitrc at /projects/cgit + # Enable cgitrc at /projects/cgit.cgi SetEnv CGIT_CONFIG /srv/www/spragg-ssl.co.uk/cgitrc - ScriptAlias /projects/cgit/ "/usr/lib/cgit/cgit.cgi/" - RedirectMatch ^/projects/cgit$ /projects/cgit/ + ScriptAlias /projects/cgit.cgi/ "/usr/lib/cgit/cgit.cgi/" + RedirectMatch ^/(.*)/cgit.cgi$ "/$1/cgit.cgi/" <Directory "/usr/lib/cgit/"> AllowOverride None Options ExecCGI FollowSymlinks Require all granted </Directory> + # Redirect for old links. + RewriteRule "^/projects/cgit$" "/projects/cgit.cgi/" [R,L] + RewriteRule "^/projects/cgit/(.*)" "/projects/cgit.cgi/$1" [R,L] # Enable the STAG trac instance over WSGI #WSGIScriptAlias /c/STAG/trac /srv/www/spragg-ssl.co.uk/html/c/STAG/trac/cgi-bin/trac.wsgi |