-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
htaccess.txt
74 lines (61 loc) · 1.79 KB
/
htaccess.txt
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
######################################
## [PHPFOX_HEADER]
##
## @copyright [PHPFOX_COPYRIGHT]
## @author Raymond Benc
## @package PhpFox
## @version $Id: htaccess.txt 7004 2013-12-20 14:23:28Z Raymond_Benc $
######################################
# Options -Indexes
# Options -Multiviews
# Header unset Pragma
# FileETag None
# Header unset ETag
# URL Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
#
# Full path to your site
#
RewriteBase /
# Rename Photo Names
# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)_([0-9]*?)\.(.*)$ file/pic/photo/$1/$2/$3_$5.$6
# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)\.(.*)$ file/pic/photo/$1/$2/$3.$5
# 301 redirect if missing www.
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.% {HTTP_HOST}/$1 [R=301,L]
# 301 redirect if missing trailing slash
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
#
# Rules
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?do=/$1
# Image Access Protection
# RewriteRule ^file/pic/photo/(.*)\.(.*)$ static/image.php?file=$1&ext=$2
</IfModule>
# Modify Headers
<IfModule mod_expires.c>
ExpiresActive ON
# Cache files
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
Header set Cache-Control "public"
ExpiresDefault "access plus 2 months"
Header unset Last-Modified
</FilesMatch>
# Cache JavaScript & CSS
<FilesMatch "\.(js|css)$">
Header set Cache-Control "public"
ExpiresDefault "access plus 2 months"
Header unset Last-Modified
</FilesMatch>
</IfModule>
# Compress JavaScript & CSS
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|php)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>