-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.htaccess
More file actions
117 lines (97 loc) · 3.48 KB
/
.htaccess
File metadata and controls
117 lines (97 loc) · 3.48 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#
# compress text,html,javascript,css,xml:
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/rss+xml
</IfModule>
<IfModule mod_headers.c>
<filesMatch "\.css$">
#Header set Content-Encoding x-deflate
# Header set Content-Encoding compress
Header set Content-Encoding x-gzip
</filesMatch>
</IfModule>
#SetOutputFilter DEFLATE
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 second"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/gif "access plus 3 month"
ExpiresByType image/png "access plus 3 month"
ExpiresByType text/css "access plus 2 month"
ExpiresByType application/javascript "access plus 3 month"
Header set Cache-Control "public"
</IfModule>
FileETag INode MTime Size
ErrorDocument 403 /script/php/error/403.php
ErrorDocument 404 /script/php/error/404.php
DirectoryIndex 'login.php','home.php'
#AddCharset
AddDefaultCharset utf-8
Options +FollowSymlinks
options -indexes
<IfModule mod_rewrite.c>
RewriteEngine on
# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ /$1 [R=301,L]
# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^([^\.]+)$.php$ /$1 [R=301,L]
#rename php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^\.]+)$ $1.php [L]
#profile page
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteCond %{QUERY_STRING} !^u= [NC]
RewriteRule ^([a-z0-9-.]+)$ profile.php?u=$1 [L,NC,QSA]
#prevent hot linkimg
RewriteCond %{HTTP_REFERER} !^$
#RewriteCond %{HTTP_REFERER} !^http://(www\.)?corz\.org/ [NC]
RewriteCond %{HTTP_REFERER} !^http://peerdisk.tk/ [NC]
RewriteCond %{REQUEST_URI} !hotlink\.(gif|png) [NC]
RewriteRule .*\.(gif|jpg|png)$ /site/img/cubebeans.png [NC]
</IFModule>
<IfModule mod_php5.c>
php_value post_max_size 5M
php_value upload_max_filesize 5M
php_value memory_limit 300M
php_value max_execution_time 259200
php_value max_input_time 259200
php_value session.gc_maxlifetime 1200
</IfModule>
php_value display_errors 0
php_value error_reporting 30719
#php_flag display_errors off
#commented out
<IfModule mod_headers.c>
#Header set Access-Control-Allow-Origin: http://localhost
#Header set Access-Control-Allow-Origin: http://peerdisk.tk
</IfModule>
#Content-Type: text/html; charset=UTF-8
#Access-Control-Allow-Origin: http://peerdisk.tk
#RewriteEngine on
#RewriteCond %{REQUEST_FILENAME}.php -f
#RewriteRule ^users/(\d+)*$ profile.php?id=$1
#RewriteRule ^([^\.]+)$ $1.php [NC]
#RewriteCond %{SCRIPT_FILENAME} !-d
#RewriteCond %{SCRIPT_FILENAME} !-f
#RewriteRule ^.*$ ./index.php
#RewriteCond %{REQUEST_FILENAME} >""
#RewriteRule ^([^\.]+)$ profile.php?user=$1 [L]
#RewriteEngine on
#RewriteCond %{REQUEST_FILENAME} -f [OR]
#RewriteCond %{REQUEST_FILENAME} -d
#RewriteRule .* - [L]
#RewriteRule ^([^\.]+)$ http://localhost/profile.php?u=$1 [NC]