Thu, September 23, 2021
 
https://devcodepro.comdevcodepro
X
Home · Latest · Trends
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: 1499  / 4 years ago, mon, feb 19, 18, 11:28:09
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
Posted
Nica Radi
Member since Oct 29, 2017
Total Code Snippets: 4
Total Comments: 1
Location: n/a
Nica Radi snippets
4 years ago, mon, dec 4, 17, 5:57:17
comments: 0 / hits: 1990
PHP
4 years ago, thu, dec 7, 17, 2:24:01
comments: 0 / hits: 1299
CSS
4 years ago, fri, feb 9, 18, 6:41:38
comments: 0 / hits: 1631