Htaccess rule to move entire site into a folder?
I have two folders in httpdocs
site_v1
site_v2
I would like to redirect the entire domain to site_v2 but also to keep reference to this
so this would work
www.example.com -> gets into site_v2
www.example.com/site_v1/ -> gets into site_v1
www.example.com/site_v2/ -> gets into site_v2
How开发者_运维问答 would be the htaccess directives for this kind of redirect?
Try this rule:
RewriteCond $0 !^(site_v1|site_v2)($|/)
RewriteRule .* site_v2/$0 [L]
精彩评论