-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
63 lines (47 loc) · 1.89 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
#In repo but not deployed. Changes must be made manually.
#Strict https
#<IfModule mod_headers.c>
# Header always set Strict-Transport-Security "max-age=16070400"
#</IfModule>
# Caching. 1 Month for most static assets
#<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
#Header set Cache-Control "max-age=2592000, public"
#</filesMatch>
# 404 Page
ErrorDocument 404 /404.php
# 403 Page
ErrorDocument 403 /404.php
<IfModule mod_rewrite.c>
RewriteEngine on
# 301 redirect to https
#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
#Force non www
#RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
#RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
#Removing Trailing Slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]
# Redirect to PHP if it exists.
# e.g. example.com/foo will display the contents of example.com/foo.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]
#Blog Previews
RewriteRule ^journal/([a-zA-Z0-9-/]+)/preview$ /journal/post.php?s=$1&preview=all [L]
#Blog Categories
RewriteRule ^journal/category/([a-zA-Z0-9-/]+)/page/([0-9]+)/{0,1}$ /journal/archive.php?cat=$1&page=$2 [L]
RewriteRule ^journal/category/([a-zA-Z0-9-/]+)$ /journal/archive.php?cat=$1 [L]
#Blog Archive
RewriteRule ^journal/date/([a-zA-Z0-9-/]+)/page/([0-9]+)/{0,1}$ /journal/archive.php?year=$1&page=$2 [L]
RewriteRule ^journal/date/([a-zA-Z0-9-/]+)$ /journal/archive.php?year=$1 [L]
#Blog Tag
RewriteRule ^journal/tag/([a-zA-Z0-9-/]+)/page/([0-9]+)/{0,1}$ /journal/archive.php?tag=$1&page=$2 [L]
RewriteRule ^journal/tag/([a-zA-Z0-9-/]+)$ /journal/archive.php?tag=$1 [L]
#Main Blog Url
RewriteRule ^journal/([a-zA-Z0-9-/]+)$ /journal/post.php?s=$1 [L]
#Portfolio URLs
RewriteRule ^case-study/([a-zA-Z0-9-/]+)$ /case-study.php?s=1 [L]
</IfModule>