-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
327 lines (282 loc) · 14.9 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
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
## Disable MultiViews
Options -MultiViews
## Security Control ##
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<FilesMatch "(composer.json|composer.lock|package.json|package-lock.json)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<IfModule mod_security.c>
SecFilterScanPOST Off
</IfModule>
## Cache Control ##
<IfModule mod_headers.c>
<FilesMatch "\.(jpg|jpeg|png|gif|svg|swf|css|js|webp)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
</IfModule>
## Gzip Control ##
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/jpg
AddOutputFilterByType DEFLATE image/png
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
## Expires Control ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
## RewriteEngine ##
RewriteEngine on
## OPTIONAL: Uploads Permission for Non-Logged In Users ##
# RewriteCond %{REQUEST_FILENAME} -s
# RewriteRule ^content/uploads/((files|photos|sounds|videos)/.*)$ files.php?file=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Installer ✅
RewriteRule ^install/?$ install.php [L,QSA]
# Sign(in|up|out) ✅
RewriteRule ^signin/?$ modules/sign.php?do=in [L,QSA]
RewriteRule ^signup/?$ modules/sign.php?do=up [L,QSA]
RewriteRule ^signout/?$ modules/sign.php?do=out [L,QSA]
RewriteRule ^reset/?$ modules/sign.php?do=reset [L,QSA]
RewriteRule ^activation/([^/]+)/?$ modules/activation.php?code=$1 [L,QSA]
# Social Logins
RewriteRule ^connect/([^/]+)/?$ modules/connect.php?do=connect&provider=$1 [L,QSA]
RewriteRule ^revoke/([^/]+)/?$ modules/connect.php?do=revoke&provider=$1 [L,QSA]
# Started ✅
RewriteRule ^started/?$ modules/started.php [L,QSA]
RewriteRule ^started/finished?$ modules/started.php?finished=true [L,QSA]
# Static Pages ✅
RewriteRule ^static/([^/]+)/?$ modules/static.php?url=$1 [L,QSA]
# Contacts ✅
RewriteRule ^contacts/?$ modules/contact.php [L,QSA]
# Directory
RewriteRule ^directory/?$ directory.php [L,QSA]
RewriteRule ^directory/([^/]+)/?$ directory.php?view=$1 [L,QSA]
RewriteRule ^directory/([^/]+)/([^/]+)/?$ directory.php?view=$1&page=$2 [L,QSA]
# Search
RewriteRule ^search/?$ search.php [L,QSA]
RewriteRule ^search/hashtag/([^/]+)/?$ search.php?query=$1&hashtag=1 [L,QSA]
RewriteRule ^search/hashtag/([^/]+)/([^/]+)/?$ search.php?query=$1&tab=$2&hashtag=1 [L,QSA]
RewriteRule ^search/([^/]+)/?$ search.php?query=$1&hashtag=0 [B,L,QSA]
RewriteRule ^search/([^/]+)/([^/]+)/?$ search.php?query=$1&tab=$2&hashtag=0 [B,L,QSA]
# Packages
RewriteRule ^packages/?$ packages.php?view=packages [L,QSA]
RewriteRule ^upgraded/?$ packages.php?view=upgraded [L,QSA]
# Messages
RewriteRule ^messages/?$ messages.php [L,QSA]
RewriteRule ^messages/new?$ messages.php?view=new [L,QSA]
RewriteRule ^messages/([^/]+)/?$ messages.php?cid=$1 [L,QSA]
# Notifications
RewriteRule ^notifications/?$ notifications.php [L,QSA]
# Settings
RewriteRule ^settings/?$ settings.php [L,QSA]
RewriteRule ^settings/([^/]+)/?$ settings.php?view=$1 [L,QSA]
RewriteRule ^settings/([^/]+)/([^/]+)/?$ settings.php?view=$1&sub_view=$2 [L,QSA]
# Live
RewriteRule ^live/?$ live.php [L,QSA]
# Posts & Photos
RewriteRule ^posts/([^/]+)/?$ post.php?post_id=$1 [L,QSA]
RewriteRule ^photos/([^/]+)/?$ photo.php?photo_id=$1 [L,QSA]
# Popular
RewriteRule ^popular/?$ index.php?view=popular [L,QSA]
# Discover
RewriteRule ^discover/?$ index.php?view=discover [L,QSA]
# Saved
RewriteRule ^saved/?$ index.php?view=saved [L,QSA]
# Memories
RewriteRule ^memories/?$ index.php?view=memories [L,QSA]
# Watch
RewriteRule ^watch/?$ index.php?view=watch [L,QSA]
# Ads
RewriteRule ^ads/?$ ads.php [L,QSA]
RewriteRule ^ads/new?$ ads.php?view=new [L,QSA]
RewriteRule ^ads/edit/([^/]+)/?$ ads.php?view=edit&campaign_id=$1 [L,QSA]
# Wallet
RewriteRule ^wallet/?$ wallet.php [L,QSA]
RewriteRule ^wallet/payments/?$ wallet.php?view=payments [L,QSA]
# Boosted
RewriteRule ^boosted/posts/?$ index.php?view=boosted_posts [L,QSA]
RewriteRule ^boosted/pages/?$ index.php?view=boosted_pages [L,QSA]
# People
RewriteRule ^people/?$ people.php [L,QSA]
RewriteRule ^people/find/?$ people.php?view=find [L,QSA]
RewriteRule ^people/friend_requests/?$ people.php?view=friend_requests [L,QSA]
RewriteRule ^people/sent_requests/?$ people.php?view=sent_requests [L,QSA]
# Pages
RewriteRule ^pages/?$ pages.php [L,QSA]
RewriteRule ^pages/liked/?$ pages.php?view=liked [L,QSA]
RewriteRule ^pages/manage/?$ pages.php?view=manage [L,QSA]
RewriteRule ^pages/category/([^/]+)/?$ pages.php?view=category&category_id=$1 [L,QSA]
RewriteRule ^pages/category/([^/]+)/([^/]+)/?$ pages.php?view=category&category_id=$1&category_url=$2 [L,QSA]
RewriteRule ^pages/category/([^/]+)/([^/]+)/([^/]+)/?$ pages.php?view=category&category_id=$1&category_url=$2&page=$3 [L,QSA]
RewriteRule ^pages/([^/]+)/?$ page.php?username=$1 [L,QSA]
RewriteRule ^pages/([^/]+)/([^/]+)/?$ page.php?username=$1&view=$2 [L,QSA]
RewriteRule ^pages/([^/]+)/([^/]+)/([^/]+)/?$ page.php?username=$1&view=$2&id=$3 [L,QSA]
# Groups
RewriteRule ^groups/?$ groups.php [L,QSA]
RewriteRule ^groups/joined/?$ groups.php?view=joined [L,QSA]
RewriteRule ^groups/manage/?$ groups.php?view=manage [L,QSA]
RewriteRule ^groups/category/([^/]+)/?$ groups.php?view=category&category_id=$1 [L,QSA]
RewriteRule ^groups/category/([^/]+)/([^/]+)/?$ groups.php?view=category&category_id=$1&category_url=$2 [L,QSA]
RewriteRule ^groups/category/([^/]+)/([^/]+)/([^/]+)/?$ groups.php?view=category&category_id=$1&category_url=$2&page=$3 [L,QSA]
RewriteRule ^groups/([^/]+)/?$ group.php?username=$1 [L,QSA]
RewriteRule ^groups/([^/]+)/([^/]+)/?$ group.php?username=$1&view=$2 [L,QSA]
RewriteRule ^groups/([^/]+)/([^/]+)/([^/]+)/?$ group.php?username=$1&view=$2&id=$3 [L,QSA]
# Events
RewriteRule ^events/?$ events.php [L,QSA]
RewriteRule ^events/going/?$ events.php?view=going [L,QSA]
RewriteRule ^events/interested/?$ events.php?view=interested [L,QSA]
RewriteRule ^events/invited/?$ events.php?view=invited [L,QSA]
RewriteRule ^events/manage/?$ events.php?view=manage [L,QSA]
RewriteRule ^events/category/([^/]+)/?$ events.php?view=category&category_id=$1 [L,QSA]
RewriteRule ^events/category/([^/]+)/([^/]+)/?$ events.php?view=category&category_id=$1&category_url=$2 [L,QSA]
RewriteRule ^events/category/([^/]+)/([^/]+)/([^/]+)/?$ events.php?view=category&category_id=$1&category_url=$2&page=$3 [L,QSA]
RewriteRule ^events/([^/]+)/?$ event.php?event_id=$1 [L,QSA]
RewriteRule ^events/([^/]+)/([^/]+)/?$ event.php?event_id=$1&view=$2 [L,QSA]
RewriteRule ^events/([^/]+)/([^/]+)/([^/]+)/?$ event.php?event_id=$1&view=$2&id=$3 [L,QSA]
# Reels
RewriteRule ^reels/?$ reels.php [L,QSA]
RewriteRule ^reels/([^/]+)/?$ reels.php?view=reel&post_id=$1 [L,QSA]
# Blogs
RewriteRule ^my/blogs/?$ index.php?view=blogs [L,QSA]
RewriteRule ^blogs/?$ blogs.php [L,QSA]
RewriteRule ^blogs/new/?$ blogs.php?view=new [L,QSA]
RewriteRule ^blogs/edit/([^/]+)/?$ blogs.php?view=edit&post_id=$1 [L,QSA]
RewriteRule ^blogs/category/([^/]+)/([^/]+)/?$ blogs.php?view=category&category_id=$1 [L,QSA]
RewriteRule ^blogs/([^/]+)/([^/]+)/?$ blogs.php?view=blog&post_id=$1 [L,QSA]
# Market
RewriteRule ^my/products/?$ index.php?view=products [L,QSA]
RewriteRule ^market/?$ market.php [L,QSA]
RewriteRule ^market/cart/?$ market.php?view=cart [L,QSA]
RewriteRule ^market/orders/?$ market.php?view=orders [L,QSA]
RewriteRule ^market/sales/?$ market.php?view=sales [L,QSA]
RewriteRule ^market/search/?$ market.php?view=search [L,QSA]
RewriteRule ^market/search/([^/]+)/?$ market.php?view=search&query=$1 [B,L,QSA]
RewriteRule ^market/search/([^/]+)/([^/]+)/?$ market.php?view=search&query=$1&page=$2 [B,L,QSA]
RewriteRule ^market/category/([^/]+)/?$ market.php?view=category&category_id=$1 [L,QSA]
RewriteRule ^market/category/([^/]+)/([^/]+)/?$ market.php?view=category&category_id=$1&category_url=$2 [L,QSA]
RewriteRule ^market/category/([^/]+)/([^/]+)/([^/]+)/?$ market.php?view=category&category_id=$1&category_url=$2&page=$3 [L,QSA]
RewriteRule ^market/([^/]+)/?$ market.php?page=$1 [L,QSA]
# Funding
RewriteRule ^my/funding/?$ index.php?view=funding_requests [L,QSA]
RewriteRule ^funding/?$ funding.php [L,QSA]
RewriteRule ^funding/([^/]+)/([^/]+)/?$ funding.php?view=funding_request&post_id=$1 [L,QSA]
# Offers
RewriteRule ^offers/?$ offers.php [L,QSA]
RewriteRule ^offers/search/?$ offers.php?view=search [L,QSA]
RewriteRule ^offers/search/([^/]+)/?$ offers.php?view=search&query=$1 [B,L,QSA]
RewriteRule ^offers/search/([^/]+)/([^/]+)/?$ offers.php?view=search&query=$1&page=$2 [B,L,QSA]
RewriteRule ^offers/category/([^/]+)/?$ offers.php?view=category&category_id=$1 [L,QSA]
RewriteRule ^offers/category/([^/]+)/([^/]+)/?$ offers.php?view=category&category_id=$1&category_url=$2 [L,QSA]
RewriteRule ^offers/category/([^/]+)/([^/]+)/([^/]+)/?$ offers.php?view=category&category_id=$1&category_url=$2&page=$3 [L,QSA]
RewriteRule ^offers/([^/]+)/?$ offers.php?page=$1 [L,QSA]
# Jobs
RewriteRule ^jobs/?$ jobs.php [L,QSA]
RewriteRule ^jobs/search/?$ jobs.php?view=search [L,QSA]
RewriteRule ^jobs/search/([^/]+)/?$ jobs.php?view=search&query=$1 [B,L,QSA]
RewriteRule ^jobs/search/([^/]+)/([^/]+)/?$ jobs.php?view=search&query=$1&page=$2 [B,L,QSA]
RewriteRule ^jobs/category/([^/]+)/?$ jobs.php?view=category&category_id=$1 [L,QSA]
RewriteRule ^jobs/category/([^/]+)/([^/]+)/?$ jobs.php?view=category&category_id=$1&category_url=$2 [L,QSA]
RewriteRule ^jobs/category/([^/]+)/([^/]+)/([^/]+)/?$ jobs.php?view=category&category_id=$1&category_url=$2&page=$3 [L,QSA]
RewriteRule ^jobs/([^/]+)/?$ jobs.php?page=$1 [L,QSA]
# Courses
RewriteRule ^courses/?$ courses.php [L,QSA]
RewriteRule ^courses/search/?$ courses.php?view=search [L,QSA]
RewriteRule ^courses/search/([^/]+)/?$ courses.php?view=search&query=$1 [B,L,QSA]
RewriteRule ^courses/search/([^/]+)/([^/]+)/?$ courses.php?view=search&query=$1&page=$2 [B,L,QSA]
RewriteRule ^courses/category/([^/]+)/?$ courses.php?view=category&category_id=$1 [L,QSA]
RewriteRule ^courses/category/([^/]+)/([^/]+)/?$ courses.php?view=category&category_id=$1&category_url=$2 [L,QSA]
RewriteRule ^courses/category/([^/]+)/([^/]+)/([^/]+)/?$ courses.php?view=category&category_id=$1&category_url=$2&page=$3 [L,QSA]
RewriteRule ^courses/([^/]+)/?$ courses.php?page=$1 [L,QSA]
# Forums
RewriteRule ^forums/?$ forums.php [L,QSA]
RewriteRule ^forums/my-threads/?$ forums.php?view=my-threads [L,QSA]
RewriteRule ^forums/my-replies/?$ forums.php?view=my-replies [L,QSA]
RewriteRule ^forums/search/?$ forums.php?view=search [L,QSA]
RewriteRule ^forums/search-results/?$ forums.php?view=search-results [L,QSA]
RewriteRule ^forums/new-thread/([^/]+)/?$ forums.php?view=new-thread&forum_id=$1 [L,QSA]
RewriteRule ^forums/edit-thread/([^/]+)/?$ forums.php?view=edit-thread&thread_id=$1 [L,QSA]
RewriteRule ^forums/new-reply/([^/]+)/?$ forums.php?view=new-reply&thread_id=$1 [L,QSA]
RewriteRule ^forums/edit-reply/([^/]+)/?$ forums.php?view=edit-reply&reply_id=$1 [L,QSA]
RewriteRule ^forums/thread/([^/]+)/([^/]+)/?$ forums.php?view=thread&thread_id=$1 [L,QSA]
RewriteRule ^forums/([^/]+)/([^/]+)/?$ forums.php?view=forum&forum_id=$1 [L,QSA]
# Movies
RewriteRule ^movies/?$ movies.php [L,QSA]
RewriteRule ^movies/search/?$ movies.php?view=search [L,QSA]
RewriteRule ^movies/search/([^/]+)/?$ movies.php?view=search&query=$1 [B,L,QSA]
RewriteRule ^movies/search/([^/]+)/([^/]+)/?$ movies.php?view=search&query=$1&page=$2 [B,L,QSA]
RewriteRule ^movies/genre/([^/]+)/?$ movies.php?view=genre&genre_id=$1 [L,QSA]
RewriteRule ^movies/genre/([^/]+)/([^/]+)/?$ movies.php?view=genre&genre_id=$1&genre_url=$2 [L,QSA]
RewriteRule ^movies/genre/([^/]+)/([^/]+)/([^/]+)/?$ movies.php?view=genre&genre_id=$1&genre_url=$2&page=$3 [L,QSA]
RewriteRule ^movies/([^/]+)/?$ movies.php?page=$1 [L,QSA]
RewriteRule ^movie/([^/]+)/([^/]+)/?$ movies.php?view=movie&movie_id=$1 [L,QSA]
# Games
RewriteRule ^games/?$ games.php [L,QSA]
RewriteRule ^games/played/?$ games.php?view=played [L,QSA]
RewriteRule ^games/genre/([^/]+)/?$ games.php?view=genre&genre_id=$1 [L,QSA]
RewriteRule ^games/genre/([^/]+)/([^/]+)/?$ games.php?view=genre&genre_id=$1&genre_url=$2 [L,QSA]
RewriteRule ^games/genre/([^/]+)/([^/]+)/([^/]+)/?$ games.php?view=genre&genre_id=$1&genre_url=$2&page=$3 [L,QSA]
RewriteRule ^games/([^/]+)/([^/]+)/?$ games.php?view=game&game_id=$1 [L,QSA]
# Developers
RewriteRule ^api/([^/]+)/?$ api.php?do=$1 [L,QSA]
RewriteRule ^developers/?$ developers.php [L,QSA]
RewriteRule ^developers/([^/]+)/?$ developers.php?view=$1 [L,QSA]
RewriteRule ^developers/edit/([^/]+)/?$ developers.php?view=edit&app_auth_id=$1 [L,QSA]
RewriteRule ^share/?$ share.php [L,QSA]
# Moderator Panel
RewriteRule ^modcp/?$ moderator.php [L,QSA]
RewriteRule ^modcp/([^/]+)/?$ moderator.php?view=$1 [L,QSA]
RewriteRule ^modcp/([^/]+)/([^/]+)/?$ moderator.php?view=$1&sub_view=$2 [L,QSA]
RewriteRule ^modcp/([^/]+)/([^/]+)/([^/]+)/?$ moderator.php?view=$1&sub_view=$2&id=$3 [L,QSA]
# Admin Panel
RewriteRule ^admincp/?$ admin.php [L,QSA]
RewriteRule ^admincp/([^/]+)/?$ admin.php?view=$1 [L,QSA]
RewriteRule ^admincp/([^/]+)/([^/]+)/?$ admin.php?view=$1&sub_view=$2 [L,QSA]
RewriteRule ^admincp/([^/]+)/([^/]+)/([^/]+)/?$ admin.php?view=$1&sub_view=$2&id=$3 [L,QSA]
# Profile
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ profile.php?username=$1 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/?$ profile.php?username=$1&view=$2 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ profile.php?username=$1&view=$2&id=$3 [L,QSA]