Loading

Redirect WWW to NON-WWW

Redirect WWW to NON-WWW

We have recently posted a guide to redirect non-www requests to www. This guide explains how to redirect www to non-www.

Requirements

  • Access to website files
  • Write permissions for .htaccess file
  • If .htaccess file not found in file manage (domain/web root), create one with name .htaccess

How to redirect www domain pages to non-www domain pages

Add the following code to your .htaccess file

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ %{REQUEST_SCHEME}://%1/$1 [R=301,L]

Drop your comment if it the above htaccess rules not working.

5 3 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x