htaccess: Redirecting multiple domains to the main domain
Let's say this is the main domain: mywebsite.com.au And you'd like to redirect several other domains that you have purchased to this main domain.The steps shown below redirects all www, non-www, http and https variations and also matches the internal pages. Step 1: Go to your DNS provider's website and point each of those purchased domains to the server that is hosting your main domain. In other words, add the IP address of your hosting server in the A record. Step 2: Log in to your WHM. Then park each domain on top of the main domain. You may be able to do this in cPanel > Aliases but I haven't tried. Step 3: If you have AutoSSL enabled, all the additional parked domains will automatically get SSL added. This may take some time. Alternatively, you can go to WHM > Manage AutoSSL and Run AutoSSL Check. Step 4: Add your parked domains to your .htaccess file as shown below. Note the "$" at the end of this line: ^www\.mywebsite\.com$ . This ...