0

I have this RewriteRule which create a permanent redirection from example1.com to example2.com

In the htaccess of example1.com I have these rules:

    #Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^(.*)$ https://www.example2.com/$1 [R=301,L]

The redirection works fine for https://www.example1.com/ (it gets redirected to https://www.example2.com). But it does not work for https://www.example1.com/about-us

I expect https://www.example1.com/about-us to be redirected to https://www.example2.com/about-us

JPashs
  • 13,044
  • 10
  • 42
  • 65

1 Answers1

0

Change your rewrite to this one:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?example1\.com [NC]
RewriteRule (.*) https://www.example2.com/$1 [R=301,L]
JarekBaran
  • 1,311
  • 2
  • 7
  • 12