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 | |
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.
-rw-r--r-- | apache2.conf | 9 | ||||
-rw-r--r-- | html/projects/index.php | 2 |
2 files changed, 7 insertions, 4 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 diff --git a/html/projects/index.php b/html/projects/index.php index f7e5f07..88c5ed1 100644 --- a/html/projects/index.php +++ b/html/projects/index.php @@ -13,7 +13,7 @@ <section> <h2><a href="https://spragg-ssl.co.uk/">The spragg-ssl.co.uk website</a></h2> <ul class="commit"> - <li>Browsable repository: <a href="cgit/spragg-ssl.co.uk/">cgit/spragg-ssl.co.uk</a></li> + <li>Browsable repository: <a href="cgit.cgi/spragg-ssl.co.uk/">cgit.cgi/spragg-ssl.co.uk</a></li> <li>Cloneable repository: <a href="spragg-ssl.co.uk.git">spragg-ssl.co.uk.git</a></li> </ul> <p>Hm. Why does browse→browsable (no "e"), but clone→cloneable (with "e")?</p> |