-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
54 lines (41 loc) · 1.5 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
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect HTTP to HTTPS and handle www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.talescroll\.ca [NC]
RewriteRule ^ https://talescroll.ca%{REQUEST_URI} [R=301,L,NE]
# Remove index.php from URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
# Remove index.html from URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.html [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.html/*(.*) /$1$2 [R=301,L]
# Enable gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css application/javascript application/x-javascript
</IfModule>
# Set default character set
AddDefaultCharset UTF-8
</IfModule>
# Prevent directory listing
Options -Indexes
# Prevent access to .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
# Protect sensitive files
<FilesMatch "\.(ini|log|sh|sql)$">
Order allow,deny
Deny from all
</FilesMatch>
# Block hotlinking of images with updated domain checks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?talescroll\.ca/.*$ [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
</IfModule>