#
# Nginx.txt
# ThinkSNS
# 

# 基本
rewrite ^/wap$                             		      /index.php?app=wap&$args last;
rewrite ^/admin$                           		      /index.php?app=admin&$args last;
rewrite ^/home$                            		      /index.php?app=home&mod=User&act=index&$args last;
rewrite ^/atme$                            		      /index.php?app=home&mod=User&act=atme&$args last;
rewrite ^/favorite$                        		      /index.php?app=home&mod=User&act=collection&$args last;
rewrite ^/comment$                         		      /index.php?app=home&mod=User&act=comments&$args last;
rewrite ^/findfriend$                      		      /index.php?app=home&mod=User&act=findfriend&$args last;
rewrite ^/login$                           		      /index.php?app=home&mod=Public&act=login&$args last;
rewrite ^/adminlogin$                      		      /index.php?app=home&mod=Public&act=adminlogin&$args last;
rewrite ^/logout$                          		      /index.php?app=home&mod=Public&act=logout&$args last;
rewrite ^/register$                        		      /index.php?app=home&mod=Public&act=register&$args last;
rewrite ^/sendPassword$                    		      /index.php?app=home&mod=Public&act=sendPassword&$args last;
rewrite ^/about/([0-9]+)$                		      /index.php?app=home&mod=Public&act=document&id=$1&$args last;
rewrite ^/404$                             		      /index.php?app=home&mod=Public&act=error404&$args last;
rewrite ^/notification$                    		      /index.php?app=home&mod=Message&act=notify&$args last;
rewrite ^/appmessage$                         		  /index.php?app=home&mod=Message&act=appmessage&$args last;

# 微博广场
rewrite ^/square$                          		      /index.php?app=home&mod=Square&act=index&$args last;
rewrite ^/square/topic$                   		      /index.php?app=home&mod=Square&act=hot_topics&$args last;
rewrite ^/square/star$                     		      /index.php?app=home&mod=Square&act=star&$args last;
rewrite ^/square/app$                                 /index.php?app=home&mod=Square&act=app&$args last;

#宝贝
rewrite ^/?welcome$                                     /index.php?app=home&mod=Welcome&act=index&$args last;
rewrite ^/?boards$                                      /index.php?app=home&mod=Boards&act=index&$args last;
rewrite ^/?shopping$                                    /index.php?app=home&mod=Shopping&act=index&$args last;
rewrite ^/?video$                                       /index.php?app=home&mod=Video&act=index&$args last;
rewrite ^/?from$                                        /index.php?app=home&mod=From&act=index&$args last;


# 私信
rewrite ^/message$                         		      /index.php?app=home&mod=Message&act=index&$args last;
rewrite ^/message/inbox$                   		      /index.php?app=home&mod=Message&act=inbox&$args last;
rewrite ^/message/outbox$                  		      /index.php?app=home&mod=Message&act=outbox&$args last;
rewrite ^/message/([0-9]+)$                		      /index.php?app=home&mod=Message&act=detail&id=$1&$args last;

# 设置
rewrite ^/setting$                          		  /index.php?app=home&mod=Account&act=index&$args last;
rewrite ^/setting/privacy$                  		  /index.php?app=home&mod=Account&act=privacy&$args last;
rewrite ^/setting/domain$                   		  /index.php?app=home&mod=Account&act=domain&$args last;
rewrite ^/setting/security$                 		  /index.php?app=home&mod=Account&act=security&$args last;
rewrite ^/setting/medal$                    		  /index.php?app=home&mod=Account&act=medal&$args last;
rewrite ^/setting/bind$                     		  /index.php?app=home&mod=Account&act=bind&$args last;
rewrite ^/setting/credit$                  		      /index.php?app=home&mod=Account&act=credit&$args last;
rewrite ^/setting/verified$                           /index.php?app=home&mod=Account&act=verified&$args last;
rewrite ^/setting/invite$                   		  /index.php?app=home&mod=Account&act=invite&$args last;

# 用户空间
rewrite ^/space$                            		  /index.php?app=home&mod=Space&act=index&$args last;
rewrite ^/space/([a-zA-Z0-9]+)$             		  /index.php?app=home&mod=Space&act=index&uid=$1&$args last;
rewrite ^/space/([a-zA-Z0-9]+)/following$   		  /index.php?app=home&mod=Space&act=follow&uid=$1&type=following&$args last;
rewrite ^/space/([a-zA-Z0-9]+)/follower$    		  /index.php?app=home&mod=Space&act=follow&uid=$1&type=follower&$args last;
rewrite ^/space/([a-zA-Z0-9]+)/profile$     		  /index.php?app=home&mod=Space&act=profile&uid=$1&$args last;
rewrite ^/board/([a-zA-Z0-9]+)$                       /index.php?app=home&mod=Space&act=board&uid=$1&$args last;

# 微博
rewrite ^/pins/([0-9]+)$                             /index.php?app=home&mod=Space&act=detail&id=$1&$args last;
rewrite ^/share/([a-zA-Z0-9]+)$                       /index.php?app=home&mod=Space&act=share&uid=$1&$args last;
rewrite ^/tools$                                      /index.php?app=home&mod=Caiji&act=tools&$args last;

# 搜索
rewrite ^/topics(?:/([^\?]*))?$                       /index.php?app=home&mod=User&act=topics&domain=$1&$args last;
rewrite ^/search$                            		  /index.php?app=home&mod=User&act=search&$args last;
rewrite ^/search/user$                       		  /index.php?app=home&mod=User&act=searchuser&$args last;
rewrite ^/search/tag$                        		  /index.php?app=home&mod=User&act=searchtag&$args last;

# 应用
rewrite ^/app/add$                           		  /index.php?app=home&mod=Index&act=addapp&$args last;
rewrite ^/app/edit$                          		  /index.php?app=home&mod=Index&act=editapp&$args last;
rewrite ^/app/install/([0-9]+)$              		  /index.php?app=home&mod=Index&act=install&app_id=$1&$args last;

# 日志
rewrite ^/app/blog$                                   /index.php?app=blog&mod=Index&act=index&$args last;
rewrite ^/app/blog/lastest$                           /index.php?app=blog&mod=Index&act=news&$args last;
rewrite ^/app/blog/following$                         /index.php?app=blog&mod=Index&act=followsblog&$args last;
rewrite ^/app/blog/my$                                /index.php?app=blog&mod=Index&act=my&$args last;
rewrite ^/app/blog/([0-9]+)$                          /index.php?app=blog&mod=Index&act=personal&uid=$1&$args last;
rewrite ^/app/blog/detail/([0-9]+)$                   /index.php?app=blog&mod=Index&act=show&id=$1&$args last;
# blog/Index/personal节点已存在, 所以去掉本条
# rewrite ^/app/blog/([0-9]+)/category/([0-9]+)$      /index.php?app=blog&mod=Index&act=personal&uid=$1&cateId=$2&$args last;
rewrite ^/app/blog/post$                              /index.php?app=blog&mod=Index&act=addBlog&$args last;
rewrite ^/app/blog/edit/([0-9]+)$                     /index.php?app=blog&mod=Index&act=edit&id=$1&$args last;
rewrite ^/app/blog/admin$                             /index.php?app=blog&mod=Index&act=admin&$args last;

# 相册
rewrite ^/app/photo$                                  /index.php?app=photo&mod=Index&act=index&$args last;
rewrite ^/app/photo/all_albums$                       /index.php?app=photo&mod=Index&act=all_albums&$args last;
rewrite ^/app/photo/all_photos$                       /index.php?app=photo&mod=Index&act=all_photos&$args last;
rewrite ^/app/photo/albums$                           /index.php?app=photo&mod=Index&act=albums&$args last;
rewrite ^/app/photo/photos$                           /index.php?app=photo&mod=Index&act=photos&$args last;
rewrite ^/app/photo/album/([0-9]+)$                   /index.php?app=photo&mod=Index&act=album&id=$1&$args last;
rewrite ^/app/photo/photo/([0-9]+)$                   /index.php?app=photo&mod=Index&act=photo&id=$1&$args last;
rewrite ^/app/photo/multi_upload$                     /index.php?app=photo&mod=Upload&act=flash&$args last;
rewrite ^/app/photo/upload$                           /index.php?app=photo&mod=Upload&act=index&$args last;
rewrite ^/app/photo/edit/([0-9]+)$                    /index.php?app=photo&mod=Manage&act=album_edit&id=$1&$args last;
rewrite ^/app/photo/order/([0-9]+)$                   /index.php?app=photo&mod=Manage&act=album_order&id=$1&$args last;

# 活动
rewrite ^/app/event$                       	          /index.php?app=event&mod=Index&act=index&$args last;
rewrite ^/app/event/events$       			          /index.php?app=event&mod=Index&act=personal&$args last;
rewrite ^/app/event/post$     				          /index.php?app=event&mod=Index&act=addEvent&$args last;
rewrite ^/app/event/edit/([0-9]+)$     		          /index.php?app=event&mod=Index&act=edit&id=$1&$args last;
rewrite ^/app/event/detail/([0-9]+)$     	          /index.php?app=event&mod=Index&act=eventDetail&id=$1&$args last;
rewrite ^/app/event/member/([0-9]+)$			      /index.php?app=event&mod=Index&act=member&id=$1&$args last;

# 投票
rewrite ^/app/vote$             		   		      /index.php?app=vote&mod=Index&act=index&$args last;
rewrite ^/app/vote/my$             			          /index.php?app=vote&mod=Index&act=my&$args last;
rewrite ^/app/vote/([0-9]+)$           		          /index.php?app=vote&mod=Index&act=personal&uid=$1&$args last;
rewrite ^/app/vote/post$     				  	      /index.php?app=vote&mod=Index&act=addPoll&$args last;
rewrite ^/app/vote/detail/([0-9]+)$     	   	      /index.php?app=vote&mod=Index&act=pollDetail&id=$1&$args last;

# 礼物
rewrite ^/app/gift$                        	          /index.php?app=gift&mod=Index&act=index&$args last;
rewrite ^/app/gift/receive$             	 	      /index.php?app=gift&mod=Index&act=receivebox&$args last;
rewrite ^/app/gift/send$               	              /index.php?app=gift&mod=Index&act=sendbox&$args last;
rewrite ^/app/gift/([0-9]+)$     	   		          /index.php?app=gift&mod=Index&act=personal&uid=$1&$args last;

# 招贴版
rewrite ^/app/poster$                                 /index.php?app=poster&mod=Index&act=index&$args last;
rewrite ^/app/poster/posters$  			              /index.php?app=poster&mod=Index&act=personal&$args last;
rewrite ^/app/poster/post$  				          /index.php?app=poster&mod=Index&act=addPosterSort&$args last;
rewrite ^/app/poster/post/([0-9]+)$  	              /index.php?app=poster&mod=Index&act=addPoster&typeId=$1&$args last;
rewrite ^/app/poster/edit/([0-9]+)$  	              /index.php?app=poster&mod=Index&act=editPoster&id=$1&$args last;
rewrite ^/app/poster/detail/([0-9]+)$  	              /index.php?app=poster&mod=Index&act=posterDetail&id=$1&$args last;

# 群组
rewrite ^/app/group$                       	          /index.php?app=group&mod=Index&act=index&$args last;
rewrite ^/app/group/my_post$                  	      /index.php?app=group&mod=Index&act=post&$args last;
rewrite ^/app/group/replied$               	          /index.php?app=group&mod=Index&act=replied&$args last;
rewrite ^/app/group/comment$               	          /index.php?app=group&mod=Index&act=comment&$args last;
rewrite ^/app/group/atme$               	  	      /index.php?app=group&mod=Index&act=atme&$args last;
rewrite ^/app/group/groups$   				          /index.php?app=group&mod=SomeOne&act=index&$args last;
rewrite ^/app/group/class$                 	          /index.php?app=group&mod=Index&act=find&$args last;
rewrite ^/app/group/search$                	          /index.php?app=group&mod=Index&act=search&$args last;
rewrite ^/app/group/add$                	  	      /index.php?app=group&mod=Index&act=add&$args last;
rewrite ^/app/group/([0-9]+)$              	          /index.php?app=group&mod=Group&act=index&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/search?$        	      /index.php?app=group&mod=Group&act=search&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/detail/([0-9]+)$         /index.php?app=group&mod=Group&act=detail&gid=$1&id=$2&$args last;
rewrite ^/app/group/([0-9]+)/invite$       	          /index.php?app=group&mod=Invite&act=create&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/setting/baseinfo$  	  /index.php?app=group&mod=Manage&act=index&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/setting/privacy$  		  /index.php?app=group&mod=Manage&act=privacy&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/setting/member$          /index.php?app=group&mod=Manage&act=membermanage&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/setting/announcement$ 	  /index.php?app=group&mod=Manage&act=announce&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/setting/log$ 			  /index.php?app=group&mod=Log&act=index&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/bbs$ 			          /index.php?app=group&mod=Topic&act=index&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/bbs/post$ 		          /index.php?app=group&mod=Topic&act=add&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/bbs/edit/([0-9]+)$       /index.php?app=group&mod=Topic&act=edit&gid=$1&tid=$2&$args last;
rewrite ^/app/group(?:/([0-9]+))?/bbs_reply/edit(?:/([0-9]+))?$ /index.php?app=group&mod=Topic&act=editPost&gid=$1&pid=$2&$args last;
rewrite ^/app/group/([0-9]+)/bbs/([0-9]+)$ 	          /index.php?app=group&mod=Topic&act=topic&gid=$1&tid=$2&$args last;
rewrite ^/app/group/([0-9]+)/file$ 			          /index.php?app=group&mod=Dir&act=index&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/file/upload$ 	          /index.php?app=group&mod=Dir&act=upload&gid=$1&$args last;
rewrite ^/app/group/([0-9]+)/member$ 		          /index.php?app=group&mod=Member&act=index&gid=$1&$args last;

# 非法链接
rewrite ^/([a-zA-Z0-9]+)$                             /index.php?app=home&mod=Public&act=error404&$args last;
