Totally confused about www or no www
-
I have my WP core files in a subdirectory with the index.php and htaccess files at the root directory. This is all working swell.
My confusion is with www or no www htaccess stuff. I was given the advice that it was important to add the code below to my htaccess file at the root directory level. But now, my site stats in Google Analytics are garbled (some weeks showing zero visits where there were visits recorded before). So I know it’s looking at the wrong site – looking at mydomain.com without the www.
Any hints about what I’ve done wrong? I know that the .htaccess file within the WP subdirectory doesn’t match the one at the root directory level. I didn’t add this www redirect code to that file. Could that be the problem?
In addition, I was using W3 Total Cache plugin for a while and recently uninstalled it, removing the code it had inserted in my htaccess file.
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # 301 redirect to domain to 'www.' RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC] RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L] </IfModule> # END WordPress
- The topic ‘Totally confused about www or no www’ is closed to new replies.