Welcome to WebmasterWorld Guest from 54.144.80.75

Forum Moderators: phranque

Message Too Old, No Replies

Canonical Issues - 4 different urls for my forum!

     
11:44 pm on Sep 28, 2010 (gmt 0)

New User

5+ Year Member

joined:May 14, 2006
posts: 34
votes: 0


I've just discovered that my forum has canonical issues. All the following urls resolve without redirection to a single url:

[mydomain.com...]
[mydomain.com...]
[mydomain.com...]
[mydomain.com...]

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?
11:46 pm on Sept 28, 2010 (gmt 0)

New User

5+ Year Member

joined:May 14, 2006
posts: 34
votes: 0


No edit button? That didnt work how I intended

The 4 different urls are:
www. and non www. versions of each of the following
forum/index.php
and
forum/
12:30 am on Sept 29, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 28, 2006
posts:1043
votes: 1


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..
[webmasterworld.com...]
1:17 am on Sept 29, 2010 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10543
votes: 8


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:
http://www.webmasterworld.com/search_engine_promotion/3541604.htm [webmasterworld.com]

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:
http://www.webmasterworld.com/accessibility_usability/3696436.htm [webmasterworld.com]
1:19 am on Sept 29, 2010 (gmt 0)

New User

5+ Year Member

joined:May 14, 2006
posts: 34
votes: 0


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?
1:26 am on Sept 29, 2010 (gmt 0)

New User

5+ Year Member

joined:May 14, 2006
posts: 34
votes: 0


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.
2:03 am on Sept 29, 2010 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10543
votes: 8


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.
2:26 am on Sept 29, 2010 (gmt 0)

New User

5+ Year Member

joined:May 14, 2006
posts: 34
votes: 0


chomp chomp.

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'.
6:51 am on Sept 29, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 28, 2006
posts:1043
votes: 1


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..
11:04 pm on Sept 29, 2010 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10543
votes: 8


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].
8:01 pm on Sept 30, 2010 (gmt 0)

New User

5+ Year Member

joined:May 14, 2006
posts: 34
votes: 0


ok, thanks for that. Got it I think.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members