-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
34 lines (28 loc) · 911 Bytes
/
.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
# Rewrites
Options -MultiViews
RewriteEngine On
# Force HTTPS, doesn't work with Cloudflare
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Insert rewrites here:
RewriteRule ^logout$ /scripts/logout.php
RewriteRule ^admin/(.*)$ admin.php?u=$1
RewriteRule ^domain/(.*)/(.*)$ domain.php?domain=$1&mail=$2
RewriteRule ^domain/(.*)$ domain.php?domain=$1
RewriteRule ^(da|en)$ /scripts/lang.php?l=$1 [L]
# No need for .php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
# Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
# 1 day cache for most static assets
<filesMatch ".(jpg|jpeg|png|gif|ico)$">
Header set Cache-Control "max-age=86400, public"
</filesMatch>
# 1 year cache for most static assets
<filesMatch ".(css|js)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>