URL rewrite regular Expressions. (non-www) to (www)

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

Redirects all server inquires to the one url to reduce duplicate indexes. AKA. http://www.ex.com and http://ex.com

Copy this code and paste it in your HTML
  1. RewriteEngine On
  2. RewriteCond %{HTTP_HOST} !^www\.
  3. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.