Sat, October 31, 2020, 07:56:04
 
Home · Latest · Trends  /  Apache
3

htaccess redirect www to non-www

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>
rated 3 times [  3] [ 0]  / comments: 0 / hits: 1273  / 3 years ago, mon, feb 19, 2018, 23:28:09
More From » Apache
 

Comments

There are no comments for this Snippet yet
Username
 
Your Comment
 
Share
Snippets
How to get clean file name / image name with extension from the URL with PHP?
3 years ago, mon, dec 4, 2017
CSS show image in a textarea with background tag
3 years ago, thu, dec 7, 2017
3 years 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.