Require “www.” : Troubleshooting & Question
-
I recently read that it is better for search engines to either ALWAYS or NEVER have “www.” in your blog URIs, but not both.
My WP General Options were set to “http://www.saphod.net”.
Well, I thought >>Give the “www.” a chance<< and included the following rules in my .htaccess-file right below RewriteBase:
# Require "www." RewriteCond %{HTTP_HOST} !^www\.saphod\.(net|com|de)$ [NC] RewriteRule ^(.*)$ http://www.saphod.net/$1 [R=301,L]
Works fine.
But I noticed that even before, a URI without “www.” was already automatically redirected.
According to the WordPress Codex, the blog URI should be without “www.”. So, as a test, I changed it to
http://saphod.net
.Result:
I got a redirection loop every time I typed in e.g.saphod.net
!Here is what I suppose:
WP already redirects to the URI provided in the options, meaning that it already strips or adds “www.”. Is that right?Therefore, the RewriteRule tries to make saphod.net –> http://www.saphod.net, then comes WordPress and changes http://www.saphod.net –> saphod.net and then the .htaccess RewriteRule comes again and the same thing happens over and over and over again.
Question:
If I am right and WP already redirects, I could leave the RewriteRule out of my .htaccess, right?A short note on this would be nice.
Thanks!
- The topic ‘Require “www.” : Troubleshooting & Question’ is closed to new replies.