I've been struggling to get HTTPS functional on my site for over ten hours now. I've got severe headache trying to set it up myself. I want you to understand that I tried several different ways to solve and asking this amazing community only as a last resort. I would really appreciate if anyone could help me out.

The website is running on Apache and the conf file looks like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteCond %{HTTPS} off
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# END WordPress

First Issue: After these changes to the conf file, I tried to reload the website and it throws an error. A redirect loop.

Second issue: When I change the site and home urls in the general settings screen to https:// from http://, it leads to a redirect loop.

I just don't understand why these are happening. I tried different variations of htaccess rules. I played with the apache configurations. Nothing worked.

Let me know if you need any other information. All help is welcome. Thank you :)


2 Answers 2


I'v added $_SERVER['HTTPS'] = 'on'; to my wp-config.php as seen on WordPress wp-admin https redirect loop and it worked perfectly!


This appeared in WordPress 4.0.

It's reported in Trac and will likely be fixed with the next version.

Meanwhile I'm trying a workaround by setting the WordPress Address (URL) to http and the Site Address (URL) to https at /wp-admin/options-general.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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