我想将旧域重定向到newdomain.right现在我们在htaccess下面使用
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
以下网址结构
olddomain.com/blog/intro/.... must redirect to newdomain.com/intro/....
答案 0 :(得分:1)
正如评论中所述:
RewriteEngine On
RewriteRule %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^blog/intro/(.*)$ http://newdomain.com/intro/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]