Redirect 301 from second domain with upload .htaccess file

Hi,

I have a website in divhunt that is connected to my main domain.

I have another second domain purchased from my web host, and I would like to set it up so that when I type it into a search engine, my website opens.

I want to redirect the domain to the home page of my website.

Example:

if I type in:
www.seconddomain.com

opens:
www.mywebsite.com

Can someone show how I can set up such a redirect?

Thanks

UPDATE:

I can’t do it in the panel with my site’s DNS settings, but on the hosting provider’s website it says that I have to upload an .htaccess file with text:

RewriteEngine On
RewriteRule ^(.*)$ https://otherdomain.com/$1 [R=301,L]

when otherdomain.com is my second domain.

No htaccess needed, you do this on domain registrar level, before anyone even hits your URL:

Using Domain Registrar’s DNS Settings

  1. Log in to your domain registrar’s control panel:
  • This is where you purchased your second domain.
  1. Find the DNS settings:
  • Look for DNS management, DNS settings, or similar options.
  1. Set up a URL Redirect:
  • Look for an option to add a URL redirect or forward.
  • Enter the details as follows:
    • Source URL: http://www.seconddomain.com
    • Destination URL: http://www.mywebsite.com
  • Save the changes.

I wrote that I cannot do this in the domain settings panel because there is no such option there…

I asked the registrar and he told me that this is the only solution…

This is the only solution that you can do through Divhunt.

Create a new empty project, connect that empty project to domain that you want to be redirecting traffic. And then create workflow to do 301 reidrect to another domain

1 Like

and this is a concrete guide.

Thanks for the explanation Stefan!

You can definitely do that with your host domain provider.

For example, in GoDaddy: Forward my GoDaddy domain | Domains - GoDaddy Help CA

What is your domain provider? Also for workflow, i can help you achieve that