forked from Kliqqi-CMS/Kliqqi-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
htaccess.default
297 lines (273 loc) · 15.7 KB
/
htaccess.default
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
AddDefaultCharset UTF-8
## 404 Error Page
## If Pligg is installed in a subfolder, change the below line to ErrorDocument 404 /name-of-subfolder/error_404.php
ErrorDocument 404 /error_404.php
## Re-directing Begin
Options +FollowSymlinks -MultiViews
RewriteEngine on
## If Pligg is installed in a subfolder, change the below line to RewriteBase /name-of-subfolder
RewriteBase /
## Force forward slash at the end of URL
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
## If installed in a subfolder, you will need to add that directory after {HTTP_HOST} on the next line.
RewriteRule (.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [R=301,L]
## If installed in a subfolder you may need to add ## to the beginning of the next line
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
## Comment out or remove these two lines if you have a sub-domain like: http://subdomain.pligg.com or http://localhost
## Keep if your site is like: http://www.pligg.com
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^localhost
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
##### Re-directing End #####
## The settings that you should configure are all above this line.
## Continue below only if you are an advanced user.
# Story and Category URLs
RewriteRule ^(all)/([^/]+)/?$ story.php?title=$2 [L]
RewriteRule ^(all)/?$ index.php [R=301,L]
# /recent redirection
RewriteRule ^upcoming/(.*)$ /new/$1 [R=301,NC,L]
RewriteRule ^new/recent/?$ new [R=301,L]
RewriteRule ^new/recent/category/([^/]+)/?$ new/category/$1 [R=301,L]
RewriteRule ^new/recent/page/(\d+)/?$ new/page/$1 [R=301,L]
RewriteRule ^new/recent/category/([^/]+)/page/(\d+)/?$ new/category/$1/page/$2 [R=301,L]
RewriteRule ^recent/?$ ./ [R=301,L]
RewriteRule ^recent/category/([^/]+)/?$ category/$1 [R=301,L]
RewriteRule ^recent/page/(\d+)/?$ page/$1 [R=301,L]
RewriteRule ^recent/category/([^/]+)/page/(\d+)/?$ category/$1/page/$2 [R=301,L]
RewriteRule ^new/recent/([^/]+)/?$ new/category/$1 [R=301,L]
RewriteRule ^new/recent/([^/]+)/page/(\d+)/?$ new/category/$1/page/$2 [R=301,L]
RewriteRule ^recent/([^/]+)/?$ category/$1 [R=301,L]
RewriteRule ^recent/([^/]+)/page/(\d+)/?$ category/$1/page/$2 [R=301,L]
## RSS
RewriteRule ^new/([^/]+)/rss/?$ rss.php?status=new&category=$1 [L]
RewriteRule ^new/rss/?$ rss.php?status=new [L]
RewriteRule ^(\d+)/rss/?$ storyrss.php?id=$1 [L]
RewriteRule ^([^/]+)/rss/?$ rss.php?category=$1 [L]
RewriteRule ^rss/?$ rss.php [L]
RewriteRule ^search/([^/]+)/rss/?$ rss.php?search=$1 [L]
RewriteRule ^group/([^/]+)/rss/?$ rss.php?status=published&group=$1 [L]
RewriteRule ^group/([^/]+)/new/rss/?$ rss.php?status=new&group=$1 [L]
RewriteRule ^group/([^/]+)/shared/rss/?$ rss.php?status=shared&group=$1 [L]
RewriteRule ^([^/]+)/([^/]+)/rss/?$ storyrss.php?title=$2 [L]
RewriteRule ^rss/([a-zA-Z0-9-]+)/?$ rss.php?status=$1 [L]
RewriteRule ^rss/category/([^/]+)/?$ rss.php?category=$1 [L]
RewriteRule ^rss/category/new/([^/]+)/?$ rss.php?status=new&category=$1 [L]
RewriteRule ^rss/category/published/([^/]+)/?$ rss.php?status=published&category=$1 [L]
RewriteRule ^rss/category/([^/]+)/new/?$ rss.php?status=new&category=$1 [L]
RewriteRule ^rss/category/([^/]+)/published/?$ rss.php?status=published&category=$1 [L]
RewriteRule ^rss/category/([^/]+)/group/([^/]+)/?$ rss.php?category=$1&group=$2 [L]
RewriteRule ^rss/category/new/([^/]+)/([^/]+)/?$ rss.php?status=new&category=$1&group=$2 [L]
RewriteRule ^rss/category/published/([^/]+)/([^/]+)/?$ rss.php?status=published&category=$1&group=$2 [L]
RewriteRule ^rss/search/([^/]+)/?$ rss.php?search=$1 [L]
RewriteRule ^rssfeeds/?$ rssfeeds.php [L]
##### URL Method 2 Begin #####
RewriteRule ^/?$ index.php [L]
RewriteRule ^advanced-search/?$ advancedsearch.php [L]
RewriteRule ^category/([^/]+)/?$ index.php?category=$1 [L]
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]
RewriteRule ^login/?$ login.php [L]
RewriteRule ^login/([a-zA-Z0-9-]+)/?$ login.php?return=$1 [L]
RewriteRule ^login/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ login.php?return=$1/$2 [L]
RewriteRule ^logout/?$ login.php?op=logout&return=index.php [L]
RewriteRule ^logout/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ login.php?op=logout&return=$1/$2 [L]
RewriteRule ^out/([\d]+)/?$ out.php?id=$1 [L]
RewriteRule ^out/(https?:.+)$ out.php?url=$1 [L]
RewriteRule ^out/([^/]+)/?$ out.php?title=$1 [L]
RewriteRule ^register/?$ register.php [L]
RewriteRule ^search/([^/]+)/page/(\d+)/?$ search.php?search=$1&page=$2 [L]
RewriteRule ^search/(.+)/?$ search.php?search=$1 [L]
RewriteRule ^searchurl/(.+)/?$ search.php?url=$1 [L]
RewriteRule ^settemplate/?$ settemplate.php [L]
RewriteRule ^story/([0-9]+)/?$ story.php?id=$1 [L]
RewriteRule ^story/([^/]+)/?$ story.php?title=$1 [L]
RewriteRule ^story/([0-9]+)/editcomment/([0-9]+)/?$ edit.php?id=$1&commentid=$2 [L]
RewriteRule ^story/([0-9]+)/edit/?$ editlink.php?id=$1 [L]
RewriteRule ^submit/?$ submit.php [L]
RewriteRule ^tag/([^/]+)/([^/]+)/?$ search.php?search=$1&tag=true&from=$2 [QSA,NC,L]
RewriteRule ^tag/([^/]+)/?$ search.php?search=$1&tag=true [QSA,NC,L]
RewriteRule ^tag/([^/]+)/page/(.+)/?$ search.php?search=$1&tag=true&page=$2 [QSA,NC,L]
RewriteRule ^tagcloud/?$ cloud.php [L]
RewriteRule ^tagcloud/range/([0-9]+)/?$ cloud.php?range=$1 [L]
RewriteRule ^topusers/?$ topusers.php [L]
RewriteRule ^trackback/([0-9]+)/?$ trackback.php?id=$1 [L]
RewriteRule ^new/?$ new.php [L]
RewriteRule ^new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/?$ new.php?part=$1 [L]
RewriteRule ^new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/?$ new.php?part=$1&category=$2 [L]
RewriteRule ^new/([^/]+)/?$ new.php?category=$1 [L]
RewriteRule ^new/page/([0-9]+)/?$ new.php?page=$1 [L]
RewriteRule ^new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/page/(\d+)/?$ new.php?part=$1&page=$2 [L]
RewriteRule ^new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/page/(\d+)/?$ new.php?part=$1&category=$2&page=$3 [L]
RewriteRule ^user/search/([^/]+)/?$ user.php?view=search&keyword=$1 [L]
RewriteRule ^user/([^/]+)/link/([0-9+]+)/?$ user_add_remove_links.php?action=$1&link=$2 [L]
# Profile
RewriteRule ^user/([^/]+)/profile/?$ user/$1/ [R=permanent]
RewriteRule ^user/([^/]+)/rss/?$ userrss.php?user=$1 [L]
RewriteRule ^user/([^/]+)/rss/([a-zA-Z0-9-]+)/?$ userrss.php?user=$1&status=$2 [L]
RewriteRule ^user/([^/]+)/edit/?$ profile.php?login=$1 [L]
RewriteRule ^user/([^/]+)/([^/]+)/?$ user.php?view=$2&login=$1 [L]
RewriteRule ^user/?$ user.php [L]
RewriteRule ^user/([^/]+)/?$ user.php?login=$1 [L]
RewriteRule ^profile/?$ profile.php [L]
## Admin
RewriteRule ^admin/?$ admin/admin_index.php [L]
RewriteRule ^admin_comments/page/([^/]+)/?$ admin/admin_comments.php?page=$1 [L]
RewriteRule ^admin_links/page/([^/]+)/?$ admin/admin_links.php?page=$1 [L]
RewriteRule ^admin_users/page/([^/]+)/?$ admin/admin_users.php?page=$1 [L]
RewriteRule ^story/([0-9]+)/modify/([a-z]+)/?$ admin/linkadmin.php?id=$1&action=$2 [L]
RewriteRule ^view/([^/]+)/?$ admin/admin_users.php?mode=view&user=$1 [L]
## Groups
RewriteRule ^join_group/action/(published|new|discard)/link/(\d+)/?$ join_group.php?action=$1&link=$2 [L]
RewriteRule ^groups/?$ groups.php [L]
RewriteRule ^groups/search/([^/]+)/?$ groups.php?view=search&keyword=$1 [L]
RewriteRule ^groups/submit/?$ submit_groups.php [L]
RewriteRule ^groups/(members|name|oldest|newest)/?$ groups.php?sortby=$1 [L]
RewriteRule ^groups/([^/]+)/?$ group_story.php?title=$1 [L]
RewriteRule ^groups/([^/]+)/page/([0-9]+)/?$ group_story.php?title=$1&page=$2 [L]
RewriteRule ^groups/([^/]+)/?$ group_story.php?title=$1&view=published [L]
RewriteRule ^groups/([^/]+)/(published|new|shared|members)/?$ group_story.php?title=$1&view=$2 [L]
RewriteRule ^groups/([^/]+)/(published|new|shared|members)/page/([0-9]+)/?$ group_story.php?title=$1&view=$2&page=$3 [L]
RewriteRule ^groups/([^/]+)/(published|new|shared|members)/category/([^/]+)/?$ group_story.php?title=$1&view=$2&category=$3 [L]
RewriteRule ^groups/([^/]+)/(published|new|shared|members)/category/([^/]+)/page/([0-9]+)?$ group_story.php?title=$1&view=$2&category=$3&page=$4 [L]
RewriteRule ^groups/delete/([0-9]+)/?$ deletegroup.php?id=$1 [L]
RewriteRule ^groups/edit/([0-9]+)/?$ editgroup.php?id=$1 [L]
RewriteRule ^groups/id/([0-9]+)/?$ group_story.php?id=$1 [L]
RewriteRule ^groups/join/([0-9]+)/? join_group.php?id=$1&join=true [L]
RewriteRule ^groups/member/admin/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=admin&userid=$3 [L]
RewriteRule ^groups/member/normal/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=normal&userid=$3 [L]
RewriteRule ^groups/member/moderator/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=$2&userid=$3 [L]
RewriteRule ^groups/member/flagged/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=flagged&userid=$3 [L]
RewriteRule ^groups/member/banned/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ groupadmin.php?id=$1&role=banned&userid=$3 [L]
RewriteRule ^groups/page/([0-9]+)/?$ groups.php?page=$1 [L]
RewriteRule ^groups/unjoin/([0-9]+)/? join_group.php?id=$1&join=false [L]
RewriteRule ^groups/withdraw/([0-9]+)/user_id/([0-9]+)/?$ join_group.php?group_id=$1&user_id=$2&activate=withdraw [L]
## Live
RewriteRule ^live/?$ live.php [L]
RewriteRule ^live/comments/?$ live_comments.php [L]
RewriteRule ^live/comments/page/([^/]+)/?$ live_comments.php?page=$1 [L]
RewriteRule ^live/published/?$ live_published.php [L]
RewriteRule ^live/published/page/([^/]+)/?$ live_published.php?page=$1 [L]
RewriteRule ^live/new/?$ live_unpublished.php [L]
RewriteRule ^live/new/page/([^/]+)/?$ live_unpublished.php?page=$1 [L]
## Modules
RewriteRule ^inbox/?$ module.php?module=simple_messaging&view=inbox [L]
RewriteRule ^sitemapindex.xml module.php?module=xml_sitemaps_show_sitemap [L]
RewriteRule ^sitemap-([a-zA-Z0-9]+).xml module.php?module=xml_sitemaps_show_sitemap&i=$1 [L]
RewriteRule ^status/([0-9]+)/?$ modules/status/status.php?id=$1 [L]
RewriteRule ^toolbar/(\d+)/?$ modules/pligg_web_toolbar/toolbar.php?id=$1
RewriteRule ^sitemap-([0-9a-z]+).xml module.php?module=xml_sitemaps_show_sitemap&i=$1 [L]
## Pages
RewriteRule ^about/?$ page.php?page=about [L]
RewriteRule ^static/([^/]+)/?$ page.php?page=$1 [L]
## Pagination
RewriteRule ^category/([^/]+)/page/([^/]+)/?$ index.php?category=$1&page=$2 [L]
RewriteRule ^page/([^/]+)/?$ index.php?page=$1 [L]
RewriteRule ^page/([^/]+)/([^/]+)category/([^/]+)/?$ index.php?page=$1&part=$2&category=$3 [L]
RewriteRule ^new/([^/]+)/page/(\d+)/?$ new.php?category=$1&page=$2 [L]
RewriteRule ^published/page/([^/]+)/([^/]+)/?$ index.php?page=$1&category=$2 [L]
RewriteRule ^published/page/([^/]+)/([^/]+)/([^/]+)/?$ index.php?page=$1&part=$2&category=$3 [L]
RewriteRule ^published/page/([^/]+)/?$ index.php?page=$1 [L]
RewriteRule ^published/page/([^/]+)/category/([^/]+)/?$ index.php?page=$1&category=$2 [L]
RewriteRule ^published/page/([^/]+)/([^/]+)category/([^/]+)/?$ index.php?page=$1&part=$2&category=$3 [L]
RewriteRule ^published/page/([^/]+)/([^/]+)/?$ index.php?page=$1&part=$2 [L]
RewriteRule ^published/page/([^/]+)/range/([^/]+)/?$ ?page=$1&range=$2 [L]
RewriteRule ^search/page/([^/]+)/([^/]+)/?$ search.php?page=$1&search=$2 [QSA,NC,L]
RewriteRule ^topusers/page/([^/]+)/?$ topusers.php?page=$1 [L]
RewriteRule ^topusers/page/([^/]+)/sortby/([^/]+)?$ topusers.php?page=$1&sortby=$2 [L]
RewriteRule ^user/page/([^/]+)/([^/]+)/([^/]+)/?$ user.php?page=$1&view=$2&login=$3 [L]
RewriteRule ^user/([^/]+)/([^/]+)/page/(\d+)/?$ user.php?page=$3&view=$1&login=$2 [L]
## Sort
RewriteRule ^(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/?$ index.php?part=$1 [L]
RewriteRule ^(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/?$ index.php?part=$1&category=$2 [L]
RewriteRule ^(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/page/(\d+)/?$ index.php?part=$1&page=$2 [L]
RewriteRule ^(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/page/(\d+)/?$ index.php?part=$1&category=$2&page=$3 [L]
RewriteRule ^new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/?$ new.php?part=$1&category=$2 [L]
RewriteRule ^new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/page/(\d+)/?$ new.php?part=$1&category=$2&page=$3 [L]
RewriteRule ^(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/?$ index.php?part=$1&category=$2 [L]
RewriteRule ^(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/page/(\d+)/?$ index.php?part=$1&category=$2&page=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/page/([^/]+)/?$ index.php?category=$1&page=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)/?$ story.php?title=$2&category=$1 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/([0-9]+)/?$ story.php?title=$2&category=$1&comment_id=$3 [L]
RewriteRule ^([^/]+)/([^/]+)/reply/([0-9]+)/?$ story.php?title=$2&category=$1&comment_id=$3&reply=1 [L]
##### URL Method 2 End #####
## Disable directory browsing
Options All -Indexes
## Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
## Block out any script trying to base64_encode stuff to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
## Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
## Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
## Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
## Block pycurl bot
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^pycurl/ [NC]
RewriteRule .* - [F]
# BEGIN Compress text files
<IfModule mod_deflate.c>
<FilesMatch "\.(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
# END Compress text files
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(css)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
<FilesMatch "\\.(js)$">
Header set Cache-Control "max-age=216000, private"
</FilesMatch>
<FilesMatch "\\.(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</FilesMatch>
</IfModule>
# END Cache-Control Headers
# BEGIN Turn ETags Off
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
# END Turn ETags Off
# BEGIN Remove Last-Modified Header
<IfModule mod_headers.c>
Header unset Last-Modified
</IfModule>
# END Remove Last-Modified Header
<files "settings.php">
order allow,deny
deny from all
</files>
<files ~ "\.(tpl|log)$">
order deny,allow
allow from none
deny from all
</files>