how to redirect www to non-www using htaccess? 301 Redirect: Http to https and www to non-www

Breaking News

how to redirect www to non-www using htaccess? 301 Redirect: Http to https and www to non-www

301 Redirect: Http to https and www to non-www - How to redirect non-www to www domain in Blogger in GoDaddy, we show you how to easily 301 redirect Http to https and non-www to www version of your domain considering you have an SSL already installed on your server, redirect https to https and www with SSL for.

how to redirect www to non-www using htaccess? 301 Redirect: Http to https and www to non-www


how to redirect www to non-www using htaccess
how to redirect www to non-www using htaccess


301 Redirect: Suppose, you have a site like https://.learnthinner.com and you need to get made sure about the server layer(SSL) to your site for better security reasons and wanted to move your entire site (incorporated all pages and pictures) to https://sitename.com with www or non-www. Making sure about your site has become fundamental strides to guarantee administrations to your clients ceaselessly and certainly. Clients, for the most part, have a sense of safety when they found that a website has a safety seal on the front of the site page address.

There are additionally paid and free SSL Certificates accessible on the net. The paid SSL Certificate is a bit expensive. If you have a decent spending plan for your site improvement, at that point go for a paid SSL Certificate. There are some acceptable free SSL Certificate benefits moreover. I have introduced Let's Encrypt SSL endorsements on a portion of my sites. It is especially simple to an arrangement on Cpanel. Please visit the site and read the directions and apply them in like manner.

Here I am demonstrating how you can divert a site from www to non-www (the other way around) and Http to https utilizing the Apache server arrangement and 301 Redirect. For More Illustration and explanation, the underneath arrangement on the Apache Server will divert the accompanying area names.

http://sitename.com
http://www.sitename.com

To

https://sitename.com
https://www.sitename.com


On the off chance that you favor the www adaptation, I will demonstrate a little change to divert the non-www to www rendition.

Apache Configuration 

On the off chance that you have consented to Apache config document, simply include the accompanying sidetrack codes or to .htaccess in the foundation of your website. If RewriteEngine On effectively connected on your .htaccess record than disregard the mainline.

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301] 

On the off chance that you need default URL to be www.sitename.com rather than sitename.com than change the fifth line

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301] 

An extra RewriteCond line (expressed prior) to extricate the hostname, and keep away from to inline the hostname in the standard. On the off chance that you need you can inline the host legitimately in the standard:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteRule ^ https://sitename.com%{REQUEST_URI} [L,NE,R=301] 

Decision: It is a basic arrangement to divert www and non-HTTPS solicitation to the authoritative space utilizing 301 Redirect. It is particularly valuable to maintain a strategic distance from content duplication issues with search engines.




Related Article: What is viral marketing (and does it actually work in 2020)? What you should know about doing it correctly

Related Article: 4 SEO Tips For Raising Search Engine Rankings - how to increase google rankings with SEO

No comments

This Img about Ads

Ad blocker detected

Ads help us fund our site, please disable the ads blocker and help us provide exclusive content to you. Thanks for the support ❤️❤️