[英].htaccess redirect one domain to other
I have wordpress multisite with 2 sites: https://www.example1.com/ AND https://www.example2.com/我有 2 个站点的 wordpress 多站点: https : //www.example1.com/和https://www.example2.com/
example2 site is a copy of example1, but 2 is new so I want to redirect all subsites to new domain. example2 站点是 example1 的副本,但 2 是新的,所以我想将所有子站点重定向到新域。 Example: https://www.example1.com /data/post1243545 to https://www.example2.com /data/post1243545
示例: https ://www.example1.com /data/post1243545 到https://www.example2.com /data/post1243545
Everything stays the same except domain除了域外,一切都保持不变
To answer the question as asked回答问题
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>
per https://wpscholar.com/blog/redirect-old-domain-to-new-domain-via-htaccess/每个https://wpscholar.com/blog/redirect-old-domain-to-new-domain-via-htaccess/
However, you could simply configure the sites to use different domains and avoid having to use htaccess entirely as described in the following link.但是,您可以简单地将站点配置为使用不同的域,而不必完全按照以下链接中的说明使用 htaccess。
https://wordpress.org/support/topic/change-domain-in-multisite/ https://wordpress.org/support/topic/change-domain-in-multisite/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.