I am trying to rewrite form http to https and www to non-www urls.
Basically if someone goes to http://www.example.com they need to be redirected to https://example.com
You can use this single rule for that requirement:
RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\. [NC] RewriteRule ^ https://garrysun.com%{REQUEST_URI} [NE,L,R=301] # rest of your rules will appear below