Forwarding domains with .htaccess

  • Posted August 15, 2014

I’m trying to forward one domain that leads to my DO droplet to another domain that also leads to the same droplet. I’ve done this in the past with a simple 301 redirect in an .htaccess file. But after adding this it still isn’t forwarding.

I’ve added the .htaccess file in the /var/www/html folder, should I try adding this further up the dir structure? Or is there a better or more suitable option to doing this?

The end result should take and forward it to instead.

I am running a ubuntu with lamp droplet by the way.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Make sure that you have AllowOverride All in your main Apache configuration for virtual hosts. If you don’t then it completely ignores .htaccess files.