-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.htaccess
92 lines (74 loc) · 4.69 KB
/
.htaccess
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
AddDefaultCharset utf-8
AddHandler server-parsed .html
# NB: this .htaccess is inherited by other vhosts e.g. docs, blog
# Try to make things vhost-specific
Options +FollowSymLinks +ExecCGI
<Files "robots.txt">
Header set Cache-Control "public, must-revalidate, max-age=7200"
</Files>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www|docs|blog).srcf.net$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]
# Make the rest of this file only apply to the main website
RewriteCond %{HTTP_HOST} ^(docs|blog).srcf.net$
RewriteRule .* - [L]
<FilesMatch "groups(\.html)?">
AuthType Ucam-WebAuth
AAAuthService https://auth.srcf.net/wls/authenticate
AARequiredPtags none
AAAlwaysDecode on
Require valid-user
</FilesMatch>
Redirect permanent /socs/ /groups
# Block any dotfiles (and implicitly /.git, /.github, etcetera)
RewriteCond %{REQUEST_URI} !^/\.well-known/
RewriteRule (^|/)\. - [forbidden]
# NB: there was historically a permanent redirect from webmail.srcf.net to www.srcf.net/squirrelmail
# which we should expect users to cache indefinitely -- so keep this pointing at something useful
RewriteRule ^squirrelmail(\.html)?(/.*)? https://www.srcf.net/webmail [R,L]
RewriteRule ^ssh-may08.txt$ https://www.srcf.net/incidents/ssh-may08.txt [R]
RewriteRule ^contact-addresses$ https://www.srcf.net/contact [R]
RewriteRule ^services(\.html)?/$ https://www.srcf.net/services [R]
RewriteRule ^signup/newsoc/?$ https://control.srcf.net/signup/society [R]
RewriteRule ^signup/?$ https://control.srcf.net/signup [R]
# Blame eb677
RewriteRule ^status/2019-02-18 https://youtu.be/C7sE0agEVNg [R]
# We don't require committee nominations to be PGP-signed anymore
RewriteRule ^keys/executive(\.html)?$ - [G]
# We used to provide the webserver's SSH host keys here but this is now done elsewhere
RewriteRule ^keys/ssh_host_dsa_key\.pub$ https://docs.srcf.net/shell-and-files/ssh.html#available-hosts [R]
RewriteRule ^keys/ssh_host_rsa_key\.pub$ https://docs.srcf.net/shell-and-files/ssh.html#available-hosts [R]
# We don't provide terminal access by Java web applet anymore (thank goodness!)
RewriteRule ^utilities/mindterm https://www.srcf.net/terminal/ [R,L]
RewriteRule ^utilities/mindterm-3.3 https://www.srcf.net/terminal/ [R,L]
RewriteRule ^utilities/ssh https://docs.srcf.net/reference/shell-and-files/ssh/ [R,L]
# Desktop service was retired in July 2017
RewriteRule ^desktop(-standalone)?(\.html)?$ https://blog.srcf.net/posts/desktop-service-closure/ [R=301,L]
RewriteRule ^webdesktop/ https://blog.srcf.net/posts/desktop-service-closure/ [R=301,L]
# Internal rewrite to avoid specifying the docs domain every time (not public)
# Use :: in place of # as the latter isn't available even within internal rewrites
RewriteRule ^_docs_rd/(.*)::(.+)$ https://docs.srcf.net/$1#$2 [R,L,NE]
RewriteRule ^_docs_rd/(.*)$ https://docs.srcf.net/$1 [R,L]
# Redirect legacy FAQs to docs
RewriteRule ^faq/basics(\.html)?$ /_docs_rd/tutorials/
RewriteRule ^faq/cgi(\.html)?$ /_docs_rd/reference/web-hosting/cgi-and-php-scripts/
RewriteRule ^faq/databases(\.html)?$ /_docs_rd/reference/other-services/sql-databases/
RewriteRule ^faq/email-hades(\.html)?$ /_docs_rd/reference/email/hades-email-service/
RewriteRule ^faq/email-pip(\.html)?$ /_docs_rd/reference/email/legacy-mail-on-pip/
RewriteRule ^faq/email(\.html)?$ /_docs_rd/reference/email/email-accounts/
RewriteRule ^faq/inappropriate-content(\.html)?$ /_docs_rd/reference/rules-and-principles/
RewriteRule ^faq/irc(\.html)?$ /_docs_rd/reference/other-services/internet-relay-chat-irc/
RewriteRule ^faq/managing-account(\.html)?$ /_docs_rd/guides/getting-started-users/
RewriteRule ^faq/memberlists(\.html)?$ /_docs_rd/reference/personal-accounts/srcf-mailing-lists/
RewriteRule ^faq/managing-socaccount(\.html)?$ /_docs_rd/reference/group-accounts/administrators/
RewriteRule ^faq/news(\.html)?$ /_docs_rd/reference/other-services/usenet-nntp/
RewriteRule ^faq/obtaining-account(\.html)?$ /_docs_rd/guides/getting-started-users/
RewriteRule ^faq/other-services(\.html)?$ /_docs_rd/reference/
RewriteRule ^faq/socmail(\.html)?$ /_docs_rd/reference/group-accounts/email/
RewriteRule ^faq/troubleshooting(\.html)?$ /_docs_rd/index.html::help-and-support
RewriteRule ^faq/web-hosting(\.html)?$ /_docs_rd/reference/web-hosting/regular-hosting/
# Redirect about to its new home
RewriteRule ^faq/about(\.html)?$ /about [R,L]
# Generically redirect FAQ pages with no obvious docs equivalent
RewriteRule ^faq/(blogging|misc|programming|user-contributed)(\.html)?$ /faq/ [R,L]