website not redirecting to www.

December 14, 2018 300 views
DNS

My website loads fine at both “example.com” and “www.example.com” however I want it to always redirect to “www.example.com” everytime I believe I have my CNAME configured correctly as the HOSTNAME “www.example.com” is an alias for “example.com”

1 Answer

Hey friend,

This can be done in a .htaccess file if mod_rewrite is enabled.

https://www.siteground.com/kb/how_to_redirect_nonwww_urls_to_www/

Jarland

Have another answer? Share your knowledge.