-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
executable file
·43 lines (34 loc) · 1.39 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
## Options to adjust access to this site.
## In this file double hash signs are used to indicate comments
## and single hash tags are use to deactivate a certain option.
## To activate the option remove the hash tag and the space after.
## Please, if you are unsure contact helpdesk first before changing this file.
## no access -- this disables all access to the site
# Require all denied
## based on ip-address
# Require ip 157.193.39.0/255.255.255.0
# Require ip 172.18.39.0/255.255.255.0
## UGent - allow access for most UGent computers
# Require ip 157.193.0.0/255.255.0.0
## eduroam
# Require ip 172.18.0.0/255.255.255.0
## full internet access - allow everyone
# Require all granted
## by default directoy listing should be off
Options -Indexes
## enable directory listing
# Options +Indexes
# DirectoryIndex none
## send all visitors to to one canonical address
## it is advised to leave this as it is
RewriteEngine On
# if starts with www rewrite to non www https version
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# 2024-07-25T15:34:02+02:00
# if an html file exists, then serve it
# reference: https://stackoverflow.com/questions/75852082/how-to-use-htaccess-to-serve-html-file-without-extension-if-exists-or-fallback
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [L]