-
Notifications
You must be signed in to change notification settings - Fork 38
/
.htaccess
41 lines (31 loc) · 1.78 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
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/2.6.2/$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/2.6/$2 [R=301,L]
# Artifact redirects
RewriteCond %{REQUEST_URI} ^/artifacts(/?)(.*)?$
RewriteRule ^ https://artifacts.sfml-dev.org/by-branch/master/ [R=301,L]