开发者

Htaccess rule to move entire site into a folder?

开发者 https://www.devze.com 2023-01-06 01:37 出处:网络
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

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

精彩评论

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