apache mod_rewrite子规则和宁静结构
我试图设置几个重写规则,允许一个宁静的url结构存在,但只在一个特定的子域。 几个子域名已经指向共享的代码库。 我也有一个现有的重写,以使用PHP smarty,它已经捕捉了一切。 所有子域名,包括宁静的域名,都需要redirect到最后一步。 最后,为了方便起见,我想尽可能将子域放入一个查询stringvariables中,以避免试图稍后以编程方式提取它。 我是mod_rewrite的新手,并且难以让所有这些工作在一起…这是我迄今为止的混合尝试,这并不完全合作。 # copy subdomain to variable. # ideally though, dev.subdomain.domain.com would only copy "subdomain", not "dev.subdomain". # this should work for all subdomain, and keep going. RewriteCond %{HTTP_HOST} (.+).domain.com [NC] RewriteRule / /$1?subdomain=%1 [QSA] # restful api, only for restful.domain.com. how to apply to all rules? RewriteCond %{HTTP_HOST} restful.domain.com […]