-
Notifications
You must be signed in to change notification settings - Fork 3
/
.htaccess
32 lines (23 loc) · 1.03 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
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect old hetongeluk.nl url's
RewriteCond %{HTTP_HOST} ^(www\.)?hetongeluk\.nl$ [NC]
RewriteRule ^ https://nl.roaddanger.org%{REQUEST_URI} [R=301,L,NE]
RewriteCond %{HTTP_HOST} ^(www\.)?hetongeluk\.be$ [NC]
RewriteRule ^ https://be.roaddanger.org%{REQUEST_URI} [R=301,L,NE]
# Add www if not a subdomain
RewriteCond %{HTTP_HOST} !^(.*)\.(.*)\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Ensure https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# No redirect if existing directory
RewriteCond %{REQUEST_FILENAME} !-d
# No redirect if existing file
RewriteCond %{REQUEST_FILENAME} !-f
# Redirect urls to index.php file. The url is sent as a GET
# QSA: Appends any query string from the original request URL to any query string created in the rewrite target.
# L: Last Rule
RewriteRule ^.+$ index.php?url=$1 [QSA,L]
</IfModule>