.htaccess redirect www subdomain to second level domain


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



Copy this code and paste it in your HTML
  1. # Redirect without www prefix
  2. RewriteCond %{HTTP_HOST} ^www\.example\.net$ [NC]
  3. RewriteRule ^(.*)$ http://example.net/$1 [r=301,NC,L]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.