RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This mostly works except for some weird behaviour and mixed test results. When I test with Google Chrome incognito mode, I type https://theaksesuar.com and first it just connects and shows some distorted version of our site. When I refresh the page then it redirects to https://www.theaksesuar.com and displays the page correctly.HTTP Headers
>>> https://theaksesuar.com
> --------------------------------------------
> 200 OK
> --------------------------------------------
Status: 200 OK
Code: 200
Server: openresty
Date: Fri, 14 May 2021 07:50:51 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Accept-Ranges: bytes
Age: 153515
Cache-Control: max-age=2592000
Content-Security-Policy: upgrade-insecure-requests
Expires: Fri, 11 Jun 2021 13:12:16 GMT
Last-Modified: Wed, 12 May 2021 09:57:00 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding, User-Agent
X-Backend: local
X-Cache: cached
X-Cache-Hit: HIT
X-Cacheable: YES
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
https://redirectdetective.com/ reports 301 fine. I will be glad if anyone can help.Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.