This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
86 lines (71 loc) · 2.8 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Options +FollowSymLinks
Options +Indexes
FileETag None
<Files ~ "^\.htaccess">
Order allow,deny
Deny from all
</Files>
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
<IfModule mod_mime.c>
# Set XML files to be read as PHP (this is for dynamic RSS feeds)
AddType application/x-httpd-php xml
# Set MIME types for fonts
AddType font/embedopentype .eot
AddType font/opentype .otf
AddType font/truetype .ttf
</IfModule>
# GZIP compression (Fonts, HTML/XML, Text, CSS, JS)
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE font/embedopentype font/opentype font/truetype text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
</IfModule>
</IfModule>
# Disable GZIP for older browsers
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
# Content Type
<FilesMatch "\.(html|htm|php|php5)$">
Header set Content-type "text/html;charset=utf-8"
</FilesMatch>
# Cache control
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=30240000, public, must-revalidate"
Header set Expires "access plus 50 weeks"
</FilesMatch>
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
Header set Expires "access plus 2 days"
</FilesMatch>
<FilesMatch "\.(js|css)$">
Header set Cache-Control "max-age=43200, public, must-revalidate"
Header set Expires "access plus 12 hours"
</FilesMatch>
</IfModule>
# Rewriting for pretty URLs
<IfModule mod_rewrite.c>
# Rewriting
RewriteEngine On
RewriteRule ^books?/([0-9-]+)/?$ index.php?view=bookView&isbn=$1 [L,QSA]
RewriteRule ^books?/add/?$ index.php?view=bookEdit&isbn=0 [L,QSA]
RewriteRule ^books?/edit/([0-9-]+)$ index.php?view=bookEdit&isbn=$1 [L,QSA]
RewriteRule ^books?/addcopy/?$ index.php?view=bookEnlist [L,QSA]
RewriteRule ^books?/check(in|out)/?$ index.php?view=bookCheck&mode=$1 [L,QSA]
RewriteRule ^books?/sell/?$ index.php?view=bookCheck&mode=sell [L,QSA]
RewriteRule ^books?/list/?$ index.php?view=bookList&format=list [L,QSA]
RewriteRule ^books?/held/?$ index.php?view=booksHeld&format=list [L,QSA]
RewriteRule ^books?/search/?$ index.php?view=bookSearch&format=list [L,QSA]
RewriteRule ^users?/([0-9-]+)/?$ index.php?view=userView&userId=$1 [L,QSA]
RewriteRule ^users?/list/?$ index.php?view=userList&format=list [L,QSA]
RewriteRule ^users?/search/?$ index.php?view=userSearch&format=list [L,QSA]
RewriteRule ^collections?/?$ index.php?view=collection [L,QSA]
RewriteRule ^collections?/([0-9]+)/?$ index.php?view=collection&collectionId=$1 [L,QSA]
RewriteRule ^(login|logout|register)/?$ index.php?view=$1 [L,QSA]
RewriteRule .* - [L,QSA]
</IfModule>