homepage Welcome to WebmasterWorld Guest from 54.197.19.35
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque & physics

Webmaster General Forum

    
Canonical Issues - 4 different urls for my forum!
steve8383




msg:4208464
 11:44 pm on Sep 28, 2010 (gmt 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?

 

steve8383




msg:4208466
 11:46 pm on Sep 28, 2010 (gmt 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/

youfoundjake




msg:4208481
 12:30 am on Sep 29, 2010 (gmt 0)

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...]

phranque




msg:4208485
 1:17 am on Sep 29, 2010 (gmt 0)

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]

steve8383




msg:4208487
 1:19 am on Sep 29, 2010 (gmt 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?

steve8383




msg:4208491
 1:26 am on Sep 29, 2010 (gmt 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.

phranque




msg:4208496
 2:03 am on Sep 29, 2010 (gmt 0)

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.

steve8383




msg:4208498
 2:26 am on Sep 29, 2010 (gmt 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'.

youfoundjake




msg:4208565
 6:51 am on Sep 29, 2010 (gmt 0)

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..

phranque




msg:4209089
 11:04 pm on Sep 29, 2010 (gmt 0)

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].

steve8383




msg:4209542
 8:01 pm on Sep 30, 2010 (gmt 0)

ok, thanks for that. Got it I think.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved