Say we have a J3.x site on mydomain.com. We also have mydomain.org and mydomain.net domains.
We want to redirect all to https://mydomain.com/cms
DNS on registrar
DNS on CP
vhost(s)
htaccess
What I did:
- Created private nameservers for mydomain.com on registrar.
- Pointed mydomain.com to ns1.mydomain.com ns2.mydomain.com
- Created the website mydomain.com on CP
- Created nameservers ns1.mydomain.com ns2.mydomain.com on CP
- Created Alias domains mydomain.org and mydomain.net under mydomain.com on CP
- Created the following htaccess at the root of mydomain.com (/home/mydomain.com/public_html)
RewriteCond %{HTTPS} off [OR]
RewriteCond %{REQUEST_URI} !^/cms/ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\. [NC,OR]
RewriteCond %{HTTP_HOST} ^mydomain.net$ [NC,OR]
RewriteCond %{HTTP_HOST} ^mydomain.org$ [NC]
RewriteRule ^/? https://mydomain.com/cms/ [R=301,L]
Anything wrong with the above steps?
I’m not sure how I can handle DNS records for mydomain.org and mydomain.net thou…
