Adding redirect from /git to /cgit for web browsers
As part of the Cgit solution for my
network, I added some logic that will redirect web browsers from any /git
URLs to the respective /cgit URLs. Maybe someday I will figure how to serve
both cgit and git on just /git, but I can deal with this forwarding
arrangement for now. Change the httpd directive from ScriptAlias /git/
/usr/libexec/git-core/git-http-backend-custom/
to
ScriptAlias /git/ /usr/sbin/git-http-backend-custom/
And the trailing slash is important! Write new file /usr/sbin/git-http- backend-custom which checks the user agent string and passes git to the real backend utility.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Comments