How to Add www to URL in Wordpreess or php Using Htaccess

You have a Web Site Called Wpdadd.com and When user try to access you website without www you need to append www at the Domain or if the user is access you page example : wpdadd.com/contact this page need to add www.wpdadd.com/contact follow the below steps

go to .htaccess find RewriteEngine on the added below for Redirecting non-www to www url

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

Add a Comment

Your email address will not be published. Required fields are marked *

five × three =