Hi,
I’m looking for a .htaccess pro.
I want to redirect from one domain to an other.
For example shop.domain1.com -> domain2.com/shop this is easy
But If I want to make an additional language parameter, it gets trickier:
shop.domain1.com/de -> domain2.com/de/shop
This almost works:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^shop\.domain1\.com$ [NC]
RewriteRule ^(.*) https://www.domain2.com/$1/shop/ [L,R]
But how can I make that /
optional, if there is no language parameter? Because now the redirected link looks like: www.domain2//shop
Thanks for all hints and help