Redirect to

  • Posted on September 3, 2014
  • ImpalooAsked by Impaloo

Hey. I’m trying to implement a permanent redirect from to

This is how my .conf file looks like.


<VirtualHost *:80 *:443>

        DocumentRoot /var/www/

        ErrorLog /var/www/
        CustomLog /var/www/ combined

<VirtualHost *:80>
        Redirect permanent /
<VirtualHost *:443>
        Redirect permanent /

This doesn’t work. It works if I want to achieve the opposite ( to however - obviously after changing a few things.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You can set up an CNAME record through the DigitalOcean DNS panel. To add a CNAME record, first click on the domain that you’d like to edit

Once you’ve done that, click the Add Record button

From there, select the CNAME Record button and enter a name for the record. The CNAME records point to a site’s canonical name. When entering your CNAME record, enter what you need the record to look up in the Name field, and then add the record it resolves to in the Hostname field.

In Name: www In Hostname: @

and this will do the work