apache tutorial - Force HTTPS using virtual host - apache - apache web server - apache server - apache2




Force HTTPS using virtual host in apache

Use Redirect to force users to connect to the secureURL.

<VirtualHost *:80>
    ServerName example.com
    SSLProxyEngine on
    Redirect permanent / https://secure_example.com/
</VirtualHost>
click below button to copy the code. By Apache tutorial team

The rest of the configuration can be put in the ssl virtual host (port 443) since everything is redirected.

<VirtualHost _default_:443>
    ServerName secure_example.com
    ServerAdmin [email protected] 
    DocumentRoot /var/www/domains/secure_example.com/html
    ErrorLog /var/log/secure_example.com/error.log
    CustomLog /var/log/secure_example.com/access.log common
    SSLEngine On
    ...
</VirtualHost>
click below button to copy the code. By Apache tutorial team

Related Searches to Force HTTPS using virtual host in Apache

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×