Home · Latest · Trends  /  Apache
2

htaccess redirect www to non-www

rated 2 times [  2] [ 0]  / comments: 0 / hits: 551  / 1 year ago, mon, feb 19, 2018, 23:28:09
Redirect www to non-www URLs using htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>
More From » Apache
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
 
Share
Snippets
How to get clean file name / image name with extension from the URL with PHP?
1 year ago, mon, dec 4, 2017
CSS show image in a textarea with background tag
1 year ago, thu, dec 7, 2017
1 year ago, fri, feb 9, 2018
Posted
Nica Radi

Nica Radi

Member since Oct 29, 2017
Total Code Snippets: 4
Total Comments: 1
Location: n/a
Following
User not following anyone yet.