-
Notifications
You must be signed in to change notification settings - Fork 2
/
.htaccess
75 lines (61 loc) · 2.49 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
#Options +FollowSymLinks
#Disable directory browsing
#Options All -Indexes
#enable rewrite rule
RewriteEngine on
#Send request via index.php
# Allow any files or directories that exist to be displayed directly
RewriteCond ${REQUEST_URI} ^.+$
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf|xml)$ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^ - [L]
#Rewrite rule
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /framework-f/index.php?p=$1&c=$2&a=$3 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)$ /framework-f/index.php?p=$1&c=$2&a=$3&lang=$4 [L]
RewriteRule ^400$ /framework-f/errors/400.html [L]
RewriteRule ^401$ /framework-f/errors/401.html [L]
RewriteRule ^403$ /framework-f/errors/403.html [L]
RewriteRule ^404$ /framework-f/errors/404.html [L]
RewriteRule ^500$ /framework-f/errors/500.html [L]
#Serve custom error pages
ErrorDocument 400 http://localhost/framework-f/400
ErrorDocument 401 http://localhost/framework-f/401
ErrorDocument 403 http://localhost/framework-f/403
ErrorDocument 404 http://localhost/framework-f/404
ErrorDocument 500 http://localhost/framework-f/500
# secure htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>