Question

I followed this tutorial on how to create owncloud on my server using SSL. The problem I'm having is that I would like to redirect any http requests to https. I'm know that my Document root for http is located in /var/www but not sure where the https one is located. I'm assuming that I have to edit or create a virtual host config that redirects to https. I do not know exactly where to create this configuration setting. In /etc/apache2/sites-enabled/000-defualt ?

I also found you can do this using mod-rewrite but I cannot seem to find my htaccess or httpd.conf files. Is this because I installed apache using Debian?

No correct solution

OTHER TIPS

You can put this inside of the 000-default file you have and it will redirect you to the secure version of your site. Replace example.com with your domain name.

<VirtualHost *:80>
    ServerName example.com
    RedirectPermanent / https://example.com/
</VirtualHost>

It looks like you already have a virtual host for SSL from the tutorial so this should be all you need. Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top