I have the following statements in an .htaccess file
RewriteCond %{HTTP_HOST} ^myOldDomain\.com$ [NC]
RewriteRule ^(.*)$ https://myNewDomaink.com/$1 [R=301,L]
It works fine. I basically found some sample code and modified it to my specific purpose. What I don't quite understand is:
Why does $1 refer to the the portion of the supplied url after the hostname - where is the documentation for this? There is no backreference in the RewriteCond.