This repository has been archived by the owner on Jul 10, 2019. It is now read-only.
forked from sayakb/sticky-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
53 lines (45 loc) · 2.53 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
# PHP.ini config stuff
php_flag magic_quotes_gpc off
# Rewrite rules
<IfModule mod_rewrite.c>
# Tell PHP that rewrite rules are available
SetEnv HTTP_MOD_REWRITE On
# Disable MultiViews
Options -MultiViews
# Rewrite rules
RewriteEngine on
# Setup link
RewriteRule ^install/?$ install.php [NC]
# Documentation links
RewriteRule ^doc/([a-z]+)/?$ doc.php?cat=$1 [NC]
RewriteRule ^~([a-z.]+)/doc/([a-z]+)/?$ doc.php?project=$1&cat=$2 [NC]
# Home page links
RewriteRule ^~([a-z.]+)/?$ index.php?project=$1 [NC]
RewriteRule ^~([a-z.]+)/api/([a-z]+)/?$ index.php?project=$1&mode=$2 [NC]
# Paste list
RewriteRule ^all/?$ list.php [NC]
RewriteRule ^api/([a-z]+)/all/?$ list.php?mode=$1 [NC]
RewriteRule ^~([a-z.]+)/all/?$ list.php?project=$1 [NC]
RewriteRule ^~([a-z.]+)/api/([a-z]+)/all/?$ list.php?project=$1&mode=$2 [NC]
RewriteRule ^rss/?$ list.php?rss=1 [NC]
RewriteRule ^~([a-z.]+)/rss/?$ list.php?project=$1&rss=1 [NC]
RewriteRule ^all/([0-9]+)/?$ list.php?page=$1 [NC]
RewriteRule ^api/([a-z]+)/all/([0-9]+)/?$ list.php?mode=$1&page=$2 [NC]
RewriteRule ^~([a-z.]+)/all/([0-9]+)/?$ list.php?project=$1&page=$2 [NC]
RewriteRule ^~([a-z.]+)/api/([a-z]+)/all/([0-9]+)/?$ list.php?project=$1&mode=$2&page=$3 [NC]
# General links
RewriteRule ^([0-9]+)/?$ show.php?id=$1 [NC]
RewriteRule ^~([a-z.]+)/([0-9]+)/?$ show.php?project=$1&id=$2 [NC]
RewriteRule ^([0-9]+)/([a-z|A-Z]+)/?$ show.php?id=$1&mode=$2 [NC]
RewriteRule ^~([a-z.]+)/([0-9]+)/([a-z|A-Z]+)/?$ show.php?project=$1&id=$2&mode=$3 [NC]
RewriteRule ^api/([a-z|A-Z]+)/([0-9]+)/?$ show.php?mode=$1&id=$2 [NC]
RewriteRule ^~([a-z.]+)/api/([a-z|A-Z]+)/([0-9]+)/?$ show.php?project=$1&mode=$2&id=$3 [NC]
RewriteRule ^([0-9]+)/([0-9]+)/?$ show.php?id=$1&hash=$2 [NC]
RewriteRule ^~([a-z.]+)/([0-9]+)/([0-9]+)/?$ show.php?project=$1&id=$2&hash=$3 [NC]
RewriteRule ^([0-9]+)/([0-9]+)/([a-z|A-Z]+)/?$ show.php?id=$1&hash=$2&mode=$3 [NC]
RewriteRule ^~([a-z.]+)/([0-9]+)/([0-9]+)/([a-z|A-Z]+)/?$ show.php?project=$1&id=$2&hash=$3&mode=$4 [NC]
RewriteRule ^api/([a-z|A-Z]+)/([0-9]+)/([0-9]+)/?$ show.php?mode=$1&id=$2&hash=$3 [NC]
RewriteRule ^~([a-z.]+)/api/([a-z|A-Z]+)/([0-9]+)/([0-9]+)/?$ show.php?project=$1&mode=$2&id=$3&hash=$4 [NC]
RewriteRule ^api/([a-z|A-Z]+)/([0-9]+)/([0-9]+)/(.*)$ show.php?mode=$1&id=$2&hash=$3&password=$4 [NC]
RewriteRule ^~([a-z.]+)/api/([a-z|A-Z]+)/([0-9]+)/([0-9]+)/(.*)$ show.php?project=$1&mode=$2&id=$3&hash=$4&password=$5 [NC]
</IfModule>