Might sound confusing, but what I want to achieve is this:
If the user visits:
www.mydomain.com
(with or withoutwww.
)transfer them to:
www.myotherdomain.com/welcome-old-users
At the same time, I want to achieve this:
If they visit:
www.domain.com/about-us
(with or withoutwww.
)transfer them to:
www.myotherdomain.com/about-us
What I have so far is this:
<IfModule mod_rewrite.c>
RewriteEngine On
# To redirect all users to HTTPS
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirects all www to non-www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteBase /
RewriteCond %{HTTP_HOST} (^www.)?mydomain.com/?$ [NC]
RewriteRule ^(.*)$ https://myotherdomain.com/$1 [R=301,L]
Which works with point #2
Any help is appreciated!