开发者

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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜