How can I set up an Addon Domain and Redirect to the Main Domain?

I have 2 domains, a .net and .org domain and I've made my main site domain using the .net domain and I would like to add the .org domain and redirect it completely (web browser) to the main domain.

I've added the 2nd domain using "Add Domains" in my CyberPanel. Then within the File Manager, I've created an .htaccess file in the folder of the Addon Domain and included the following code to redirect the .org domain to the .net domain.

This is an example of what I have right now:

Path: /home/

Code added to the .htaccess file:
RewriteEngine on
RewriteRule ^(.*)$$1 [R=301,L]
It's not working. What am I doing wrong? What do I need to do to make this work? I rather not do Domain Alias because I want the .org domain to automatically redirect to .net domain. I don't want duplicate content, and I don't want my site to show content on both domains simultaneously, either or.

I have another website on a different host that uses cPanel and there is an Addon Domain feature which I've used successfully to create an addon domain. I'm also using the same coding above to redirect the .org to the .net (main site domain). It works like it should.

I'd appreciate the help and information on how to make this work. This is only my 2nd day using a panel like CyberPanel. I'm still learning. :smile:


Sign In or Register to comment.
Support CyberPanel 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