forked from KodiCMS-Kohana/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
56 lines (43 loc) · 1.41 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
AddDefaultCharset utf8
# Disabled cache, enabled profiling
# SetEnv KOHANA_ENV DEVELOPMENT
# Enabled profiling, enabled cache
# SetEnv KOHANA_ENV TESTING
# Enable css|js files Cache-Control
# Required apache modules: mod_headers or mod_expires
# <Filesmatch "\.(jpg|jpeg|png|gif|js|css)$">
# <ifmodule mod_headers.c>
# Header add "Expires" "Mon, 28 Jul 2014 23:30:00 GMT"
# Header add "Cache-Control" "max-age=315360000"
# </ifmodule>
# <ifmodule mod_expires.c>
# ExpiresActive on
# ExpiresDefault "access plus 2 days"
# </ifmodule>
# </Filesmatch>
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Redirect www to non-www
# RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
# RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Redirect non-www to www
# RewriteCond %{HTTP_HOST} !^www\.
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
Options -Indexes
# Protect application and system files from being viewed
# RewriteRule ^(?:cms)\b.* index.php/$0 [L]
RewriteRule ^(cms/application|cms/system|cms/modules)/ - [F,L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php [PT]
# Alternate variant
# RewriteRule .* index.php/$0 [PT]