.htaccess 将页面从一个域重定向到另一个域页面

.htaccess 将页面从一个域重定向到另一个域页面,.htaccess,redirect,.htaccess,Redirect,我看起来有点胆怯,但似乎找不到解决问题的正确答案。我有4个域,我需要重定向3个域(和他们的一些网页)到新的一个 https://www.domain1.com/ 到https://www.domain4.com/music/domain1/ https://www.domain2.com/ 到https://www.domain4.com/music/domain2/ https://www.domain3.com/ 到https://www.domain4.com/mu

我看起来有点胆怯,但似乎找不到解决问题的正确答案。我有4个域,我需要重定向3个域(和他们的一些网页)到新的一个

https://www.domain1.com/     到https://www.domain4.com/music/domain1/

https://www.domain2.com/     到https://www.domain4.com/music/domain2/

https://www.domain3.com/     到https://www.domain4.com/music/domain3/

我在一些页面上也需要它,例如:

https://www.domain1.com/about.php    到https://www.domain4.com/domain1/about/

有人能帮我在htaccess中怎么做吗


提前感谢

请您尝试以下内容,并按照所示样本书写。将这些规则放入.htaccess文件后,在测试之前,请确保清除浏览器缓存

RewriteEngine ON
RewriteCond %{HTTP_HOST} ^(?:www\.)(domain[123])\.com [NC]
RewriteCond %{REQUEST_URI} ^/?$
REwriteRule ^(.*)$ https://www.domain4.com/music/%1/ [NE,L]

RewriteCond %{HTTP_HOST} ^(?:www\.)(domain[123])\.com [NC]
RewriteCond %{REQUEST_URI} ^/(about)\.php/?$
REwriteRule ^(.*)$ https://www.domain4.com/%1/%2/ [NE,L]

你好,Aleksandar Simovic,很抱歉打扰您,请您检查一下我的解决方案是否对您有所帮助?您可以在我的解决方案的评论部分让我知道。