<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f


RewriteRule ^wap\/(.*)$  wap\/$1 [QSA,L]

RewriteRule ^api\/(\w+)$  api\.php\?act=$1 [QSA,L]

# 重写图片验证码
RewriteRule ^verify&rand=(.*)$  verify\.php?rand=$1 [QSA,L]

# 邮件退订
RewriteRule ^subscribe\/unsubscribe&code=(.*)$  subscribe\.php\?act=unsubscribe&code=$1 [QSA,L]
RewriteRule ^subscribe\/dounsubscribe&code=(.*)$  subscribe\.php\?act=dounsubscribe&code=$1 [QSA,L]

# 取回密码
RewriteRule ^user\/modify_password&code=(.*)$  user\.php\?act=modify_password&code=$1 [QSA,L]

#会员团购券
RewriteRule ^uc_coupon\/(\d+)$  uc_coupon\.php\?act=index&id=$1 [QSA,L]

# 重写直接ID的访问
RewriteRule ^(\w+)\/(\d+)$  $1\.php\?id=$2 [QSA,L]

# 重写关于邀请链接
RewriteRule ^deal\/(\d+)\/r\/(\d+)$  deal\.php\?id=$1&r=$2 [QSA,L]

# 重写如 http://www.easethink.com/deal/
RewriteRule ^(\d+)$  index.php?act=index&id=$1 [QSA,L]
RewriteRule ^(\w+)$  $1\.php?act=index [QSA,L]
RewriteRule ^(\w+)&(.*)$  $1\.php?act=index&$2 [QSA,L]

# 重写如 http://www.easethink.com/deal/history
RewriteRule ^(\w+)\/(\w+)$  $1\.php\?act=$2 [QSA,L]

# 重写如 http://www.easethink.com/deal/history/1
RewriteRule ^(\w+)\/(\w+)\/(\d+)$  $1\.php\?act=$2&id=$3 [QSA,L]

# 重写如 http://www.easethink.com/deal/history/1&abc
RewriteRule ^(\w+)\/(\w+)\/(\d+)&(.*)$  $1\.php\?act=$2&id=$3&$4 [QSA,L]

# 重写如 http://www.easethink.com/link/go&abc
RewriteRule ^(\w+)\/(\w+)&(.*)$  $1\.php\?act=$2&$3 [QSA,L]

</IfModule>