public
Description: Basic virtual pet game (in the vein of neopets.com) built using the MVC pattern.
Homepage: http://kittokittokitto.yasashiisyndicate.org
Clone URL: git://github.com/OwlManAtt/kittokittokitto.git
Click here to lend your support to: kittokittokitto and make a donation at www.pledgie.com !
kittokittokitto / .htaccess
100644 46 lines (36 sloc) 2.4 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
# This controls what config options to use.
# SetEnv RELEASE_MODE DEV
 
RewriteEngine On
RewriteBase /kitto
 
# These are the real folders.
RewriteRule ^resources/(.*)$ resources/$1 [L]
RewriteRule ^docs/(.*)$ docs/$1 [L]
 
# Specific, prettier URLs.
RewriteRule ^profile/([0-9]+) index.php?page_slug=profile&user_id=$1 [NC,L]
RewriteRule ^pet/([0-9]+) index.php?page_slug=pet&pet_id=$1 [NC,L]
RewriteRule ^edit-pet/([0-9]+) index.php?page_slug=edit-pet&pet_id=$1 [NC,L]
RewriteRule ^shop/([0-9]+) index.php?page_slug=shop&shop_id=$1 [NC,L]
RewriteRule ^notice/([0-9]+) index.php?page_slug=notice&state=jump&notification_id=$1 [NC,L]
 
# Pagination for /items/ - /items is still handled by the catch-all, etc.
RewriteRule ^items/([0-9]+) index.php?page_slug=items&page=$1 [NC,L]
RewriteRule ^news/([0-9]+) index.php?page_slug=news&page=$1 [NC,L]
RewriteRule ^crafting/([0-9]+) index.php?page_slug=crafting&page=$1 [NC,L]
 
# Messages - first pagination. Then we have two URLs mapped to our write-new
# slug - /write-new-message/ and /write-message-reply/. -new accepts a user ID,
# and -reply takes a message ID. Slick.
RewriteRule ^messages/([0-9]+) index.php?page_slug=messages&page=$1 [NC,L]
RewriteRule ^write-new-message(/([0-9]+))? index.php?page_slug=write-message&to_user_id=$2 [NC,L]
RewriteRule ^write-message-reply(/([0-9]+))?(/(all))? index.php?page_slug=write-message&reply_to_id=$2&reply_to_all=$4 [NC,L]
RewriteRule ^message/([0-9]+) index.php?page_slug=message&message_id=$1 [NC,L]
 
# The boards need to support both a 'nice' URL (/thread/1) AND a page number
# on that URL (/thread/1/2/).
RewriteRule ^threads/([0-9]+)(/([0-9]+))? index.php?page_slug=threads&board_id=$1&page=$3 [NC,L]
RewriteRule ^thread/([0-9]+)(/([0-9]+))? index.php?page_slug=thread&thread_id=$1&page=$3 [NC,L]
RewriteRule ^edit-post/([0-9]+)(/([0-9]+))? index.php?page_slug=edit-post&post_id=$1&page=$3 [NC,L]
RewriteRule ^edit-thread/([0-9]+)(/([0-9]+))? index.php?page_slug=edit-thread&thread_id=$1&page=$3 [NC,L]
 
# Search page rules.
RewriteRule ^search/([a-z0-9]+)(((/([^/]+))(/(exact|contains)?)(/([0-9])+)?))? index.php?page_slug=search&state=search&search=$1&term=$5&page=$9&precision=$7 [NC,L]
 
# Craft things.
RewriteRule ^craft/([0-9]+) index.php?page_slug=craft&id=$1 [NC,L]
 
# Gotta catch 'em all! Don't put any rules below this one.
RewriteRule ^([A-Z0-9-]+)(/(.*))?$ index.php?page_slug=$1 [QSA,NC,L]