Home forword btn Ashish forword btn How to Redirect www to non www using Htaccess

Ashish How to Redirect www to non www using Htaccess

How to Redirect www to non www using Htaccess

How to Redirect www to non www using Htaccess

Now we are explain how to redirect website www to non www using htaccess file, we explain step by step you can learn easily.

Now you create .htaccess file and put the code above…

# redirect website www to non www without https

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]

RewriteRule (.*) http://example.com/$1 [R=301,L]

 

# redirect website www to non www with https

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]

RewriteRule (.*) https://example.com/$1 [R=301,L]

 

Save your htaccess file and upload your root domain….enjoy…thanks…

Tags: redirect www to non www, redirect www to non www with http and https

  • Submit Date5 months ago
  • CategoryPHP
  • 11
  • ';
  • Comment2

Leave Your Comment

Login to post a comment


Thanks ashish for posting useful information...

my Redirect www to non www using Htaccess is successful thanks for posting.