Ensuring that your www subdomain redirects correctly is crucial for SEO. Here’s how you can check and set up the redirection for both Shopify and WordPress (WooCommerce).
Shopify
- Log in to your Shopify admin panel.
- Go to Online Store > Domains.
- In the Primary domain section, you can choose whether you want to use the www or non-www version of your domain.
- Shopify automatically sets up the necessary redirects to ensure that all traffic is directed to your primary domain.
WordPress (WooCommerce)
- Log in to your WordPress admin panel.
- Go to Settings > General.
- In the WordPress Address (URL) and Site Address (URL) fields, enter your preferred version of the domain (either with www or without www).
- To ensure proper redirection, you may need to edit your
.htaccess
file. Add the following code to redirect non-www to www:RewriteEngine On RewriteCond %{HTTP_HOST} ^yourdomain.com [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301,NC] Or add this code to redirect www to non-www:
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
By following these steps, you can ensure that your www subdomain redirects correctly, which helps in consolidating your site’s authority and improving SEO.