Generate clean, production-grade Apache .htaccess 301 permanent redirect directives with VibeTool's Free Htaccess Redirect Generator. Unifying your website's canonical domain structure\u2014routing either from www to non-www or from non-www to www\u2014is one of the most critical foundational technical SEO requirements. Canonicalizing your hostname prevents duplicate content penalties, consolidates PageRank and backlink equity, and ensures uniform SSL encryption delivery across all incoming web requests.
www.example.com → example.com) or non-www to www (e.g., example.com → www.example.com).http://, https://, or www (e.g., yourdomain.com)..htaccess file.www.example.com and example.com as two independent websites unless explicitly instructed via server 301 headers.The .htaccess file is typically located in your website's root document directory (usually public_html/, www/, or htdocs/). It is a hidden file, so enable "Show Hidden Files (dotfiles)" in your FTP client or hosting cPanel file manager.
From an organic search perspective, Google and Bing have no preference between www and non-www. What matters critically is consistency: picking one canonical format and strictly redirecting the other with 301 status headers.
No. Place the generated redirection block at the very top of your .htaccess file, above any WordPress # BEGIN WordPress or framework rewrite blocks.
Yes, VibeTool's Htaccess Redirect Generator is 100% free with unlimited rule generation and no registration required.
Fast review — stays on this site