My site has been hosted on https://example.com
But the problem is when i try to access it with https://www.example.com it still accessible. But i don't want to user to access the site with www instead of it i want to redirect it to https://example.com . How do i make it happen?
Here is the current .htaccess
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]