- If you want to open your site with out www then just simple write 2 lines in you .htaccess file and upload it in your root server.
For example:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domainname.com [NC]
RewriteRule ^(.*)$ http://domainname.com/$1 [L,R=301]
Note: In above example replace your currect domainname. If you have SSL certificate then used https:// instead of http://.
- And if you want used force www on without www domain name,
- Then just below 2 lines in your .htaccess file and upload in your root server.
For example:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domainname.com [NC]
RewriteRule ^(.*)$ http://www.domainname.com/$1 [L,R=301,NC]
Note: In above example replace your currect domainname. If you have SSL certificate then used https:// instead of http://.
If you have any question related any .htaccess rules issue then please comment me here I will you to solved that.
Enjoy!