This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi all
I recently installed a SSL certificate for a website. I got everything redirected by basically just updating the site url from the Wordpress admin. However there is a strange issue so basically if I visit http://site.com or http://www.site.com or even http://site.com/page1 it correctly redirects to https version. However if i enter http://www.site.com/page1, it doesn't redirect to https version! What could be causing this? Thank you!
PS. The htaccess file has just the default rules that come with Wordpress:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Solution: Updating this in case it helps someone. So basically I tried everything for almost a day but nothing worked except for this! It's the 2nd line (ENV:HTTPS) which is the key in getting it to work!
RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Subreddit
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Wordpress/c...