Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to force www or non-www in htaccess
#1
Heart 
Code:
#Force www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
 
Code:
#Force non-www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
[Image: logo.png]
Cheapest web hosting starting with the lowest price of $ 0.5
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)