forked from jaws-project/jaws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtaccess
52 lines (42 loc) · 1.63 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
#
# To use search engine friendly URLs check that mod_rewrite is enabled, and then copy this file to .htaccess
# You may need change this file to compatibility with your server configuration
#
# Not found error
ErrorDocument 404 /index.php?http_error=404
<FilesMatch "(favicon\.(ico|png|gif|jpg)|robots\.txt)$">
ErrorDocument 404 "File Not Found"
</FilesMatch>
# Forbidden error
ErrorDocument 403 /index.php?http_error=403
# Don't show directory listing
# For security reasons, Option followsymlinks cannot be overridden
Options -ExecCGI -FollowSymLinks +SymLinksIfOwnerMatch -Indexes
# Encoding issues
AddType 'text/html; charset=UTF-8' html
AddType 'text/xml; charset=UTF-8' atom rss xml
<IfModule mod_rewrite.c>
RewriteBase /
RewriteEngine On
# shortcut to access admin area
RewriteRule ^admin$ /admin.php [NC,L]
RewriteRule ^admin&checksess$ /admin.php/?checksess [NC,L]
# working without using index.php from URLs for better SEO optimization
RewriteCond $1 !^(favicon\.(ico|png|gif|jpg)|robots\.txt|admin\.php) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(jpg|jpeg|png|gif|swf|flv|mp3|ico|pdf)$">
Header unset Set-Cookie
FileETag -INode MTime Size
Header unset Last-Modified
Header set Cache-Control "max-age=31536000, public, must-revalidate"
</FilesMatch>
<FilesMatch "\.(js|css)$">
FileETag None
Header unset Set-Cookie
Header set Cache-Control "max-age=2592000, public, must-revalidate"
</FilesMatch>
</IfModule>