0

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.