redirect without www to www

In order to redirect all of the requests for to, you should set the appropriate rewrite rule. This can be done by adding the following lines at the beginning of the .htaccess file in your public_html folder

# adapt and uncomment the following:

RewriteCond %{HTTP_HOST} ^oldforsale\.com$ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

put above code in .htacess

Was this article helpful?