-
Notifications
You must be signed in to change notification settings - Fork 38
/
.htaccess
104 lines (82 loc) · 3.95 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
93
94
95
96
97
98
99
100
101
102
103
104
ErrorDocument 403 /error-403.php
ErrorDocument 404 /error-404.php
Header set Content-Security-Policy "default-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.sfml-dev.org www.gstatic.com www.google.com www.google-analytics.com ssl.google-analytics.com; connect-src 'self' www.google-analytics.com; img-src 'self' https: data:; style-src 'self' 'unsafe-inline' *.sfml-dev.org fonts.googleapis.com; media-src https: data:; font-src 'self' fonts.gstatic.com; base-uri 'self'; form-action 'self'; frame-src https: data:"
RewriteEngine On
# Append the www. prefix for all sites except en.*/fr.*/mirror1.* subdomains
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^en\. [NC]
RewriteCond %{HTTP_HOST} !^fr\. [NC]
RewriteCond %{HTTP_HOST} !^mirror1\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Force https:// for all except some selected URLs
RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST} !/ip-provider.php [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Force http:// for selected URLs
RewriteCond %{HTTPS} on
RewriteCond %{THE_REQUEST} /ip-provider.php [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Documentation redirects
RewriteCond %{REQUEST_URI} ^/documentation(/?)(\.php)?$
RewriteRule ^ /documentation/latest/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/documentation/latest(/?)(.*)$
RewriteRule /latest(/?)(.*) /documentation/3.0.0/$2 [R=301,L]
# Tutorial redirects
RewriteCond %{REQUEST_URI} ^/tutorials(/?)(\.php)?$
RewriteRule ^ /tutorials/latest/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/tutorials/latest(/?)(.*)$
RewriteRule /latest(/?)(.*) /tutorials/3.0/$2 [R=301,L]
# Artifact redirects
RewriteCond %{REQUEST_URI} ^/artifacts(/?)(.*)?$
RewriteRule ^ https://artifacts.sfml-dev.org/by-branch/master/ [R=301,L]
# Pre-MkDocs redirects
RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteRule ^ / [R=301,L]
RewriteCond %{REQUEST_URI} ^/index-fr\.php$
RewriteRule ^ /fr/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/learn\.php$
RewriteRule ^ /learn/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/learn-fr\.php$
RewriteRule ^ /fr/learn/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/license\.php$
RewriteRule ^ /license/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/license-fr\.php$
RewriteRule ^ /fr/license/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/faq\.php$
RewriteRule ^ /faq/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/community\.php$
RewriteRule ^ /community/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/community-fr\.php$
RewriteRule ^ /fr/community/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/development\.php$
RewriteRule ^ /development/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/development-fr\.php$
RewriteRule ^ /fr/development/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/issues\.php$
RewriteRule ^ /development/issues/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/issues-fr\.php$
RewriteRule ^ /fr/development/issues/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/changelog\.php$
RewriteRule ^ /development/changelog/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/contribute\.php$
RewriteRule ^ /development/contribute/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/style\.php$
RewriteRule ^ /development/style/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/workflow\.php$
RewriteRule ^ /development/workflow/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/download\.php$
RewriteRule ^ /download/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/download-fr\.php$
RewriteRule ^ /fr/download/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/download/bindings\.php$
RewriteRule ^ /download/bindings/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/download/bindings-fr\.php$
RewriteRule ^ /fr/download/bindings/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/download/goodies/index\.php$
RewriteRule ^ /download/goodies/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/download/goodies/index-fr\.php$
RewriteRule ^ /fr/download/goodies/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/download/sfml/old-versions\.php$
RewriteRule ^ /download/sfml/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/download/sfml/old-versions-fr\.php$
RewriteRule ^ /fr/download/sfml/ [R=301,L]