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

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...