WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] entire site in ssl (only) (2 posts)

  1. flisespikker
    Member
    Posted 5 years ago #

    I use WP-mu (mu.wordpress.org). I want to use only ssl (https on port 443), any requests to port 80 will be forwarded to the front page using https:443 instead. The one major issue with this is that WP-mu seems to hard code "http://" and they have removed the possibility to change this for the site.

    Any hints and thoughts?

    Bjørge

  2. flisespikker
    Member
    Posted 5 years ago #

    # All should use ssl!
    <VirtualHost *:443 >
    DocumentRoot /var/www/wpmu
    ServerName b.uib.no
    ServerAlias *.b.uib.no
    CustomLog logs/access_log_wpmu combined
    ErrorLog logs/error_log_wpmu
    <Directory /var/www/wpmu>
    AllowOverride FileInfo Options
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    # But we do some exceptions
    <VirtualHost *:80 >
    DocumentRoot /var/www/wpmu
    ServerName b.uib.no
    ServerAlias nossl.b.uib.no
    CustomLog logs/access_log_wpmu combined
    ErrorLog logs/error_log_wpmu
    <Directory /var/www/wpmu>
    AllowOverride FileInfo Options
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    # Then we do redirects on the rest
    <VirtualHost *:80 >
    ServerName b.uib.no
    ServerAlias *.b.uib.no

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(.*).b.uib.no
    RewriteRule ^(.*) https://%1.b.uib.no$1 [R,L]
    </VirtualHost>

    Remember to enable mod_ssl.

    To secure the initial login form add this to wp-config.php:
    define( 'FORCE_SSL_LOGIN', true);

Topic Closed

This topic has been closed to new replies.

About this Topic