[英]how to redirect all pages to another domain, except home page, using .htaccess
我想将所有页面(主页除外)从一个域重定向到另一个域。
我该怎么做呢?
这是您必须添加到htaccess文件的规则。
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
#if not root
RewriteCond %{REQUEST_URI} !^/?$ [NC]
#redirect
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.