-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.htaccess
65 lines (50 loc) · 1.86 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
55
56
57
58
59
60
61
62
63
64
65
Options +FollowSymLinks -Multiviews
Options -Indexes
RewriteEngine On
# Allow php including svg files
<IfModule mod_php5.c>
php_value short_open_tag 0
</IfModule>
# Force HTTPS on server
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?shalomshanti\.com$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Force www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^shalomshanti.com [NC]
RewriteRule ^(.*)$ https://www.shalomshanti.com/$1 [L,R=301,NC]
# Load program as homepage until further notice
RewriteEngine on
RewriteCond %{HTTP_HOST} shalomshanti.com/?$ [NC]
RewriteRule ^$ https://www.shalomshanti.com/program.pdf [L,R=302,NC]
# Find apis
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^API/(.+)$ /shalomshanti/API/$1.php [L,QSA]
# Find templates
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^templates/(.+)$ /shalomshanti/templates/$1.php [L,QSA]
# Load latest deepavali invite
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^deepavali/?$ deepavali/%{TIME_YEAR}.gif [L,QSA]
# Find pages
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|png|svg|woff|ttf|otf)$
RewriteCond %{REQUEST_URI} (totals|rsvp-confirmation|rsvp|events|plan-your-trip|savethedate)$
RewriteRule ^(.+)$ /shalomshanti/pages/$1.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+).css$ $1.css.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^program$ program.pdf [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+).js$ $1.js.php [L,QSA]
# Find php files
RewriteRule ^saveTheDateEmailImage.png$ /shalomshanti/loadEmailImage.php [L,QSA]
# Cache images for a year
<FilesMatch "\.(ico|pdf|jpg|jpeg|png|gif|svg)$">
Header set Cache-Control "max-age=31536050"
</FilesMatch>
# Cache css & js for a day
<FilesMatch "\.(css|js)$">
Header set Cache-Control "max-age=86400"
</FilesMatch>
ErrorDocument 404 /shalomshanti/404.php