How to server wordpress from SSL and non-SSL URLs

I have a standard wordpress installation with no plugins residing in /var/www/blog on my root server. It uses an Apache2, mod_rewrite, mod_ssl and that is configured just fine and works perfectly for anything but WordPress.

My .htaccess is:

Read More
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule (.*)  http://%{SERVER_NAME}%{REQUEST_URI}
#RewriteCond %{HTTP_HOST} ^somesite.info [NC]
#RewriteRule (.*) https://somesite.info%{REQUEST_URI} [R=301,L]

RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

A couple of things are wrong:

  • I need http and https, http://www. and https:/www.
  • FF displays my site just fine, Chrome loads the CSS and JS from http:// – that is bad

I have added the variables to the wp-config.php:

 define('WP_HOME','http:/somesite.info/blog');                                                                                                             
 define('WP_SITEURL','http://somesite.info/blog');                                                                                   

How can I define the variables so that all the 4 possible URL schemes get supported?
The shown rewrite conditions in comments make me end up in a redirect loop.
My WordPress is behind a reverse proxy, so I assume the .htacess stuff doesn’t fit.

Best,
ww

Related posts

2 comments

Comments are closed.