-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhtaccess (edit me before install)
executable file
·37 lines (35 loc) · 1.21 KB
/
htaccess (edit me before install)
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
RewriteOptions inherit
# Uncomment this on a live site
#<IfModule mod_headers.c>
# <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
# Header set Cache-Control "max-age=604800, public"
# </FilesMatch>
#</IfModule>
#Disable Directory Browsing
#Options All -Indexes
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
Options +SymLinksIfOwnerMatch
# Redirect HTTP with www to HTTPS without www
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule .* https://%1%{REQUEST_URI} [R=301,L]
# Redirect HTTP without www to HTTPS without www
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Redirect HTTPS with www to HTTPS without www
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule .* https://%1%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?url=$1 [L,QSA]
</IfModule>
# Block Access to .ini, .db, .sql, .htaccess Files
<FilesMatch "(^.*\.([Ii][Nn][Ii]|[Dd][Bb]|[Ss][Qq][Ll]|[Hh][Tt][Aa])|~)$">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>