-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.htaccess
More file actions
58 lines (45 loc) · 2.57 KB
/
Copy path.htaccess
File metadata and controls
58 lines (45 loc) · 2.57 KB
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
Options -Indexes
#RewriteEngine On
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteEngine on
RewriteRule ^botathon/team([0-9]+) /botathon/team.php?team_num=$1 [L,END]
# Internal-only endpoints are called pod-to-pod over plain HTTP (e.g. the Discord
# bot -> api/internal/send-email.php). Serve them directly and skip the
# canonical-host / HTTPS redirects below, which would otherwise 301 the internal
# caller off to the public URL.
RewriteRule ^api/internal/ - [L]
# The canonical-host / force-HTTPS redirects below are skipped for local
# development hosts (Docker/compose serves over http://localhost) via the
# "!^(localhost|127.0.0.1)" condition on each rule. Production hosts are never
# localhost, so prod behaviour is unchanged.
RewriteCond %{HTTP_HOST} !^(localhost|127\.0\.0\.1|dev\.untrobotics\.com|dev2\.untrobotics\.com)(:[0-9]+)?$ [NC]
RewriteCond %{HTTP_HOST} !^www.untrobotics.com [NC]
RewriteRule ^(.*)$ https://www.untrobotics.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^(localhost|127\.0\.0\.1|dev\.untrobotics\.com|dev2\.untrobotics\.com)(:[0-9]+)?$ [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} !^(localhost|127\.0\.0\.1|dev\.untrobotics\.com|dev2\.untrobotics\.com)(:[0-9]+)?$ [NC]
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L]
RewriteRule ^discord$ /auth/join-discord.php [L]
RewriteRule ^join/discord$ /auth/join-discord.php [L]
RewriteRule ^join/w/discord$ /auth/join-with-authorization-discord.php [L]
RewriteRule ^join/campuslabs$ /auth/join-campuslabs.php [L]
# path params
RewriteRule ^merch/amazon/([A-Za-z0-9-]+)/?$ /merch/amazon.php?id=$1 [L]
RewriteRule ^merch/product/([0-9a-f]+)/?([a-z-]*)$ /merch/product.php?id=$1&desc=$2 [L]
RewriteRule ^merch/product/([0-9a-f]+)/([a-z-]*)/([0-9]+)$ /merch/product.php?id=$1&desc=$2&variant=$3 [L]
RewriteRule ^merch/product/([0-9a-f]+)/([0-9+])$ /merch/product.php?id=$1&variant=$2 [L]
RewriteRule ^merch/product/([0-9a-f]+)/?(.*) /merch/product.php?id=$1&desc=$2 [L]
# tmp
RewriteRule ^join$ /auth/join.php [L]
RewriteRule ^aero/sponsor$ /downloads/nasa-sli-sponsorship-2022.pdf [R=301,L]
RewriteRule ^b4$ /botathon [R=301,L]
RewriteRule ^b4r$ /botathon/register [R=301,L]
RewriteRule ^b$ /botathon [R=301,L]
RewriteRule ^br$ /botathon/register [R=301,L]