Best practice for .com / .net / .org Joomla! sites & redirection — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberHosting

Best practice for .com / .net / .org Joomla! sites & redirection

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...

Comments

  • You can't redirect different top level domains .com .net .org etc within the same .htaccess file.
    If your main site is .com concentrate on getting that working properly, then either create seperate sites with redirects for the other domains or just forward them at the registrar.
  • Actually I was doing it on cPanel / Apache for ages. But I think my problem is with the DNS handling in CyberPanel, I couldn't understand it after a week of usage.

    In any case, you are right, it will be more logical to forward them at the registrar.

    Thank you :)
  • edited July 24
    The DNS settings (powerdns) are very similar to the bind settings in Cpanel, if you wish to use private nameservers (ns1,2.yourdomain.com) like you suggest, remember that you need to register glue at your registrar and in your DNS settings.
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion