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:

<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

I'm using a plugin for this called WordPress HTTPS. If you still intend to code a solution yourself, maybe you can get some ideas from it at least.

Read about WordPress is_ssl() not working behind reverse proxies and install the SSL Insecure Content Fixer plugin so that you can easily test whether you can add a fix based on $_SERVER['HTTP_X_FORWARDED_PROTO']; see that plugin's FAQ.

If you have the misfortune to be hosted by Network Solutions, you can fix your problem by installing this simple plugin and setting your home and site URLs to use https: full time.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.