January 23, 2016

htaccess rule for redirect non www to www.


- You can define following two line just for redirect your non www to wwww, If anyone open your site without www like http://domainname.com then its automatically redirect to  http://www.domainname.com,

- See below example:

RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]


Enjoy :)

No comments:

Post a Comment

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...