cPanel
- Log in to your cPanel account.
- Navigate to the “Domains” section and click on “Redirects”.
- Choose the domain you want to redirect from the drop-down menu.
- Select “Permanent (301)” as the type of redirect.
- Enter the non-www URL (e.g., example.com) as the source URL.
- Enter the www URL (e.g., www.example.com) as the destination URL.
- Click on “Add” or “Add Redirect”.
How to Redirect Non-www to www URLs ?
Redirecting non-www to www URLs entails ensuring that when people access your website via a URL without the “www” prefix (e.g., `example.com`), they are automatically routed to the version with the “www” prefix (`www.example.com`). This redirection is often used to maintain a consistent URL structure. It can be accomplished via server-side configuration (an Apache.`htaccess`file or Nginx configuration) or DNS settings provided by your domain registrar or DNS provider.