Nowadays, many users check online for varied queries ranging from grocery shopping to dinner at a restaurant. A website is therefore a business necessity from the smallest to the largest. To get the highest level of business pages on Google we must follow Google SEO analysis. Getting a high-quality URL is one of the keys. Let’s see how URL redirection helps with improved google ranking and website security.
Wrong URL – How Can ‘www’ Affect SEO?
The non-www domain is simple and easy to remember but it has some disadvantages. The domain www helps avoid both the opportunity to redirect the page or to split internal links with any duplicate content when search engines index the site. Therefore, it improves Search Engine Optimization (SEO) for your site. If you are using a non-www URL, redirecting it to www may seem daunting, but it is not a complicated process. Non-adherence to non-www domains has some drawbacks, including a lack of protection from congestion and cookie controls.
Users will not be able to redirect website traffic from non-www domains to another server because it does not have a CNAME Record. As a result, if a website gets more traffic users it will not be able to redirect traffic to another server.
Therefore, visitors can have a problem when accessing a website, and it will have a negative impact on SEO websites and google rankings.
Search engines will view https://www.domainname.com and http: //domainname.com as separate websites. Therefore, they will list the websites individually and the user has to explain the different aspects of SEO.
Additionally, to use a non-www domain, you must create a separate domain to deliver static content in order to use a free cookie domain. The www URL allows the user to limit cookies to a primary or subdomain and will reduce the HTTP request thus enhancing the website performance.
Note: Please do not make any changes to the .htaccess file directly. Save the .htaccess file as a backup and make changes. A few changes can slow down a website.
To Set a Non-www URL to WWW add the following code to the .htaccess file
# 301 RETURN-WWW TO WWW <IfModule mod_rewrite.c> RewriteEngine Unlocked RewriteCond% {HTTP_HOST} ^ (?! www \.) (. +) [NC] Rewrite Rule ^ (. *) Http: //www.%1/$1 [R = 301, NE, L] </IfModule>
Why HTTP to HTTPS Redirection is Important for a Website?
Website security is important. When a user accesses a website, it should be secure and reliable.
When a user accesses an insecure website google provides a warning and may affect the number of website visitors, therefore, the user needs to install an SSL certificate to protect the website. After adding an SSL Certificate user, you need to redirect the URL from HTTP to HTTPS.
However, most older websites still use the HTTP version but if a user tries to access an unsafe website a warning message pops up, risking the credibility of the website. Therefore, it is important to redirect the HTTP URL to HTTPS for increasing website security and user experience. Users can redirect HTTP to HTTPS by adding the code below to the .htaccess file.
# 301 REDIRECT HTTP TO HTTPS <IfModule mod_rewrite.c> RewriteEngine Unlocked RewriteCond% {HTTPS} is off RewriteRule ^ (. *) $ Https: //% {HTTP_HOST}% {REQUEST_URI} [L, R = 301] </IfModule>
The captions above will help the user in redirecting the URL from HTTP to HTTPS, but there are many captions you can use in the .htaccess file and make your life easier. Just make sure you have a backup copy of the active copy in case of any problem.
Conclusion -To get top-ranking and secure website, user needs to redirect the non-www domain to www domain and install an SSL certificate.