1

I need to redirect all traffic to both https and www on a WordPress site. I have gone through dozens of stackoverflow posts and feel like I finally found the answer here: htaccess redirect to https://www

I am using the code below in my htaccess file and it's somewhat working. The root domain inspiresoftware.com is redirecting to https://www.inspiresoftware.com. However if I go directly to a subpage ex. inspiresoftware.com/library, it redirects to the www version, but not the https version. What do I need to edit to make it do both? Thanks!

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /q
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
jphogan
  • 157
  • 1
  • 15
  • 1
    I assume you got the answer from here: https://stackoverflow.com/a/13997498/1526322 -- Did you see the section about proxying? Does that apply to you? – Knox Mar 21 '18 at 16:47
  • @Knox unfortunately, not. Thanks for the help though! – jphogan Mar 21 '18 at 20:31

0 Answers0