Changes domainname.tld into www.domainname.tld


/ Published in: Apache
Save to your folder(s)

Changes domainname.tld into www.domainname.tld


Copy this code and paste it in your HTML
  1. ## Changes domainname.tld into www.domainname.tld
  2. Options +FollowSymLinks
  3. RewriteEngine On
  4. RewriteBase /
  5. RewriteCond %{HTTP_HOST} !^www\.domainname\.com$ [NC]
  6. RewriteRule ^(.*)$ http://www.domainname.com/$1 [R=301]
  7. RewriteRule ^(.*)\.html$ $1.php [R=301,L]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.