Report this

What is the reason for this report?

how to redirect on Ubuntu/Apache from domain.org/public_html to domain.org?

Posted on February 13, 2014

After following the steps from these 2 articles:

  1. https://www.digitalocean.com/community/articles/how-to-launch-your-site-on-a-new-ubuntu-12-04-server-with-lamp-sftp-and-dns
  2. https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts

I’m able to type in my domain name and get some where, except I get to the default apache view of what’s inside a directory. The one item in there is a directory named public_html.

Because of the articles, I put my files into the public_html directory. How do make my droplet serve the files in public_html when someone goes to my domain name?

I figure it has to do with: -htaccess? -httpdconf? -symlink? -virtual host?

I would love to be able to make sense of this stuff. thanks!



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!

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.

Change the webroot so it’s /var/webdir/public_html instead (change this, it depends on how you set it up.)

What is the full path to your files? Can you also pastebin your virtualhost configs?

@Kamal, the full path to my files is $ /var/www/domain.org/public_html

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.