-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
166 lines (138 loc) · 6.79 KB
/
.htaccess
File metadata and controls
166 lines (138 loc) · 6.79 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
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
Options +FollowSymLinks -MultiViews
# Secuirty Control
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>
# Cache Control
<IfModule mod_headers.c>
<FilesMatch "\.(jpg|jpeg|png|gif|swf|css|js)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
</IfModule>
# Gzip Control
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE image/jpg
AddOutputFilterByType DEFLATE image/png
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/javascript
</IfModule>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L,QSA]
# Installer
RewriteRule ^install/?$ install.php [L,QSA]
# Static Pages
RewriteRule ^static/([^/]+)/?$ static.php?url=$1 [L,QSA]
# Contacts
RewriteRule ^contacts/?$ 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/([^/]+)/?$ search.php?query=$1&hashtag=0 [L,QSA]
# Sign(in|up|out)
RewriteRule ^signin/?$ sign.php?do=in [L,QSA]
RewriteRule ^signup/?$ sign.php?do=up [L,QSA]
RewriteRule ^signout/?$ sign.php?do=out [L,QSA]
RewriteRule ^reset/?$ sign.php?do=reset [L,QSA]
RewriteRule ^activation/([^/]+)/([^/]+)/?$ activation.php?id=$1&token=$2 [L,QSA]
# Social Logins
RewriteRule ^connect/([^/]+)/?$ connect.php?do=connect&provider=$1 [L,QSA]
RewriteRule ^revoke/([^/]+)/?$ connect.php?do=revoke&provider=$1 [L,QSA]
# Packages
RewriteRule ^packages/?$ packages.php [L,QSA]
# Started
RewriteRule ^started/?$ started.php [L,QSA]
RewriteRule ^started/finished?$ started.php?finished=true [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]
# Posts & Photos
RewriteRule ^posts/([^/]+)/?$ post.php?post_id=$1 [L,QSA]
RewriteRule ^photos/([^/]+)/?$ photo.php?photo_id=$1 [L,QSA]
# Saved
RewriteRule ^saved/?$ index.php?view=saved [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/([^/]+)/?$ 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/([^/]+)/?$ 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/([^/]+)/?$ 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]
# 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]
# Blogs
RewriteRule ^articles/?$ index.php?view=articles [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/([^/]+)/([^/]+)/?$ blogs.php?view=article&post_id=$1 [L,QSA]
# Market
RewriteRule ^products/?$ index.php?view=products [L,QSA]
RewriteRule ^market/?$ market.php [L,QSA]
RewriteRule ^market/search/?$ market.php?view=search [L,QSA]
RewriteRule ^market/search/([^/]+)/?$ market.php?view=search&query=$1 [L,QSA]
RewriteRule ^market/search/([^/]+)/([^/]+)/?$ market.php?view=search&query=$1&page=$2 [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]
# Games
RewriteRule ^games/?$ games.php [L,QSA]
RewriteRule ^games/played/?$ games.php?view=played [L,QSA]
RewriteRule ^games/([^/]+)/?$ game.php?id=$1 [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
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]