|Canonical Issues - 4 different urls for my forum!|
I've just discovered that my forum has canonical issues. All the following urls resolve without redirection to a single url:
Obviously this is undesirable and means that external link juice is not consolidated to a single url.
Is this something I should fix via htaccess or the rel canonical meta tag?
Should I set up a 301 redirect for all these after I make the change?
Which of the 4 url options is the better, if any?
No edit button? That didnt work how I intended
The 4 different urls are:
www. and non www. versions of each of the following
I would recommend fixing it through the .htaccess file.
You can either choose www or non-www, that is ultimately up to you. Also, check inside your forum configuration page if it gives you an option to specify what the URl should be... www.mydomain.com or mydomain.com
Me personally, I enjoy having a www.mydomain.com/forum/ as the page, because to me the www communicates to the world the type of service being offered, (as opposed to ftp, smtp, pop) and I have grown to dislike extensions at the end of a url, php, html, asp, so on..
I like referring to this thread when needed..
there are actually two places you should fix this:
- you should implement the 301 redirect in .htaccess to canonicalize the hostname while removing the default directory index document from the url.
- you should make sure all your internal navigation links use canonical urls.
if you have any influence on inbound links, you should also get those changed to use canonical urls.
|the www communicates to the world the type of service being offered, (as opposed to ftp, smtp, pop) |
you are actually referring to the URI Scheme [iana.org], which in this case would be http: and makes the www. subdomain somewhat redundant.
there are several good reasons to use subdomains but protocol specification isn't one of them.
No More WWW:
|I have grown to dislike extensions at the end of a url, php, html, asp, so on.. |
two good reasons for going extensionless are to hide your server technology and to make server technology changes less painful.
No More Extensions:
Thanks Jake, all fixed up.
The forum configuration panel (vbseo) enabled me to redirect forum/index.php to forum/ For the non www to www my htaccess had the correct lines, but I just found out they were commented out, doh!
I agree www.mydomain.com/forum/ is my preferred syntax too.
Re the other thread you linked thanks for that. I have some work ahead as both folder/index.htm and folder/ deliver the same page without redirecting.
One further question if I may, do the htaccess rewrites mean I dont need to use a 301 redirect to concentrate incoming link juice to the preferred url?
Thank you Phranque, you posted while I was typing my last response.
I guess I've got more stuff to chew on here, and here was me thinking it was a 5 minute job.
here's even more to chew on...
rewrites and redirects should not be confused.
rewrites are internal to the server and the response is for the originally requested url.
redirects involve a 301 or 302 status code response and a Location header so that the user agent can make subsequent request of a new url.
regarding your current solution, you should test your response headers and make sure you aren't getting chained redirects when you request http://example.com/forum/index.php so that the "non www to www" and index directory document canonicalization occurs with a single 301 redirect.
you might also want to test a request for http://example.com/forum to see if you get a reasonable response - either a 404 or a 301 to the trailing slash url, unless you actually have a resolvable resource at the non-trailing-slash url.
So since the htaccess www/non www tweak is a redirect not a rewrite I dont need to worry about a 301?
Quick question, how do I 'test response headers'.
There used to be a header response tool here on WebmasterWorld. Can't find it right now.
A search for "check server header status" will reveal a site that will process the status, whether its 200, 404, 301, 302, 500, and so on..
|So since the htaccess www/non www tweak is a redirect not a rewrite I dont need to worry about a 301? |
i'm not sure what your question means, but a redirect is either a 301 or a 302.
in my response i was referring to this statement:
|One further question if I may, do the htaccess rewrites mean I dont need to use a 301 redirect to concentrate incoming link juice to the preferred url? |
you should use mod_rewrite/RewriteRules in your .htaccess to redirect all non-canonical requests to the canonical url with 301 status code responses.
|Quick question, how do I 'test response headers'. |
there are many methods to test responses, for example the Live HTTP Headers Add-on for Firefox [addons.mozilla.org].
ok, thanks for that. Got it I think.