Accessing Your Domain With or Without WWW
Yes, your website will load with both www.yourdomain.com and yourdomain.com by default. Both versions point to the same website content.
Choose One as Your Primary (Important for SEO)
While both versions work, search engines treat them as separate URLs. Having both active without a redirect creates duplicate content. Pick one as your primary version and redirect the other to it.
Force WWW:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC]
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R=301,L]
Force non-WWW:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$ [NC]
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]
Add whichever redirect you prefer to your .htaccess file in public_html. Most modern websites use the non-www version since it is shorter and cleaner, but either choice is fine as long as you are consistent.
If you use WordPress, also make sure Settings > General has the correct version (with or without www) set for both WordPress Address and Site Address.
