Htaccess: very basic questions

Hi all,

Would someone mind please providing the htaccess code to:

  1. Remove “www” from any URLs
  2. Capitalize the domain name
  3. Change http to https

I’m not sure if #3 is necessary because this is my first time installing an SSL certificate. We can use “” for the purposes of the code above.


I am not sure why are you removing WWW and Capitalize from the point of SEO.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I am not sure this is correct or not but wait for and another member reply.

You can easily edit from your cPanel hosting or ask your hosting provider to do for you.

Thank you. Can anyone confirm the code?

The www is unnecessary. The capitalization is a preference. I do not believe that either will affect search engine optimization, but if anyone believes otherwise, please let me know.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.