In this video you will learn how to redirect non-www URL to www.
Write the following code in your .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^the-digital-oceans.com
RewriteRule (.*) https://www.the-digital-oceans.com/$1 [R=301,L]
Check the following playlist to explore your knowledge: