Apache .htaccess重写规则
问题描述:
试图在合并之后让旧站点重定向到新站点。Apache .htaccess重写规则
blog.example.com到 - > store.example.com/blog
#Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) https://store.example.com/$1 [R=301,L]
RewriteRule ^$ /blog [L]
我缺少什么?
答
一个重写规则应该足够了:
RewriteEngine on
RewriteRule ^(.*)$ https://store.example.com/blog/$1 [NE,L,R=301]
是重定向到https://store.example.com/不https://store.example.com//blog – Joe
然后,你必须把它弄坏了复制?这里是在线测试你可以尝试:http://htaccess.mwl.be/ –
谢谢,我帮了我很多,得到它与您的原始代码工作 – Joe