How do I redirect a domain?

I have my domain mydomain.com which opens my site correctly at mydomain.com. I want to redirect say mydomains1.com to open my site at mydomain.com. I was thinking of adding a record mydomains1.com to target the IP address at mydomain.com but this is not working.
Any suggestions??

1 Reply

I was thinking of adding a record mydomains1.com to target the IP address at mydomain.com but this is not working.

  • Establish the domain mydomain.com with an IP address.
  • Establish the domain mydomains1.com with an IP address (can be the same IP address as in #1…for a single Linode it should be).
  • Wait for propagation to happen (24 hours).
  • In your (apache2) web server, set up something like this:
<VirtualHost *:80>
ServerName mydomains1.com
Redirect 301 / http://mydomain.com/
</VirtualHost>

<VirtualHost *:80>
ServerName mydomain.com
. . .
. . .
</VirtualHost>
  • Restart apache2:
sudo systemctl restart apache2
  • Test with your browser.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct