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
10 months ago
PHP
- 11
';
2



Thanks ashish for posting useful information...
my Redirect www to non www using Htaccess is successful thanks for posting.
RECENT POSTS
CATEGORIES
Copyrights © 2021 SoftechBharat. All Rights Reserved.
Leave Your Comment
Login to post a comment