How to add 301 Redirect from non www to www for Wordpress
Feb 16, 2022
In this tutorial, you will learn how to add a 301 redirect to your wordpress website.
Read this tutorial here http://bit.ly/38mgZUZ
It is a best practice to take backup before you edit the .htaccess file. Do it only if you know what you are doing or consult a software engineer.
Copy the following script and paste it in the beginning of .htaccess file.
# BEGIN 301 redirect from example.com to www.example.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# END 301 redirect from example.com to www.example.com
This video addresses the Redundant hostnames warning from google analytics that has following message:
Property example.com is receiving data from redundant hostnames. Some of the redundant hostnames are:
example.com
www.example.com
Redundant hostnames are counted as separate rows in reports, so hits that are going to the same page on your site from different hostnames will be split into multiple rows. With data split across multiple rows, traffic to specific pages will appear lower than it actually is.
To avoid this problem, consider setting up a 301 redirect from one of your redundant hostnames to the other, or create a search-and-replace filter that strips "www." from hostnames.
Google Tag Assistant Recordings can help you verify that your redirect is setup correctly, or that your filter is working as intended.
If you found the video tutorial useful, spread the word by sharing this video.
------------------------------------------------------------------------------------------------
????????? to ???????? channel if you like the content.
?????????: http://bit.ly/2Y0ZunB
Share this video with your friends and colleagues and let them know you are upto date with latest tech-trends
Follow us:
Facebook: http://bit.ly/2Djmd6l
Twitter: http://bit.ly/2Ol9ZQT
Instagram: http://bit.ly/2pV4cYY
Support:
(Appreciate your Generosity: ?)
PayPal: http://bit.ly/2NZgVma
ETH: 0x0689Ecd747d6F4eA9CE491aD0b1734fEe62b2229
Show More Show Less 