RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.blueseotools.com [NC]
RewriteRule ^(.*)$ https://blueseotools.com/$1 [L,R=301,NC]
I have set up it for the base URL which works fine now but URLs under it are still accessible with both www and non-www prefixes eg : (https://www.blueseotools.com/robots-txt-generator) and (https://blueseotools.com/robots-txt-generator)