How to setup 301 redirect from non-www to www and subfolder

If you want to redirect non-www URL to https://www. which improves search engine optimisation rankings, use following .htaccess rule as,

Here is what .htaccess solved the problem,

[code] RewriteEngine On RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] [/code]

How to verify your websites current redirects ?

Just type your domain name in and click Trace, or you can also use

For more help refer below URLs :


You can also refer to good information at

Leave a Comment