Redirect subfolder(s) to new domain while keeping URL with htaccess

Viewed 19

When I type in the URL: www.domainA.com/something/stockach/schwimmbad/hallenbad-stockach

I want to redirect to: wwww.domainB.com/something/stockach/schwimmbad/hallenbad-stockach/

Basically, I just need to replace the URL www.domainA.com/something/./././ with www.domainB.com/something/./././ but only if it starts with domain.com/something/

And I want to keep the same URL in the address bar [R=301,P]

I've tried with htaccess but we no success. What I have so far:

RewriteCond %{HTTP_HOST} ^(www\.)?itstoolong\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/something/ [NC]
RewriteCond %{SERVER_PORT} =443
RewriteRule ^(.*)$ https://wordpress-bremen.de/$1 [R=301,P]

Where do I go wrong? Btw. I am working with WordPress.

0 Answers
Related