Yes, I know this question has been asked 1000 times before... here is the difference...

I found this answer on StackOverflow to ADD the "www" here:
[use htaccess to add www with https support](https://stackoverflow.com/questions/2097542/use-htaccess-to-add-www-with-https-support)

```
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

And it is the most beautiful and graceful solution I have ever seen:

* It works
* It doesn't need to be changed to be used for a specific domain
* It addresses both HTTP and HTTPS connections
* Its only 3 lines

So, my question is simple. Can someone help me adapt this code to work in the opposite direction? (To remove the WWW from web addresses and address all the above points)?

I believe that between the above (and hopefully below) solutions, we will have the www rewrite to rule them all!