1 (edited by AlexanderS 2009-07-19 19:06)

Topic: Have all Last Post links point to Topic instead.

I'm sure this is a simple one for a lot of you guys, but not for me.

I want the change all last post links to point to the subject Topic instead, while maintaining the links appearance designating the date and time of the last post. I know the links will no longer point directly to the last post (instead, the top of the topic page), but I believe this to be a small but valid SEO advantage, because it eliminates duplicate URLs without losing your total number of internal links. phpBB has a mod that does just that.

I think, for the Index page last posts I need to change some stuff here, or maybe not.:

//$forums_info = $db->query('SELECT num_topics, num_posts, parent_forum_id, last_post_id, last_poster, last_post, id, forum_name FROM '.$db->prefix.'forums ORDER BY disp_position') or error(implode($db->error(),''),__FILE__,__LINE__,$db->error());

$forums_info = $db->query('SELECT f.num_topics, f.num_posts, f.parent_forum_id, f.last_post_id, f.last_poster, f.last_post, f.id, f.forum_name, p.poster_id as last_poster_id, t.subject FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'posts AS p ON (p.id=f.last_post_id) LEFT JOIN '.$db->prefix.'topics AS t ON t.last_post_id=f.last_post_id ORDER BY disp_position') or error(implode($db->error(),''),__FILE__,__LINE__,$db->error());
while($current = $db->fetch_assoc($forums_info)) {
 if ($current['parent_forum_id'] != 0)
  {
   $sfdb[$sfcount][0] = $current['parent_forum_id'];
   $sfdb[$sfcount][1] = $current['num_topics'];
   $sfdb[$sfcount][2] = $current['num_posts'];
   $sfdb[$sfcount][3] = $current['last_post_id'];
   $sfdb[$sfcount][4] = $current['last_poster'];
   $sfdb[$sfcount][5] = $current['last_post'];
   $sfdb[$sfcount][6] = $current['id'];
   $sfdb[$sfcount][7] = $current['forum_name'];
   $sfdb[$sfcount][8] = $current['last_poster_id'];
   $sfdb[$sfcount][9] = $current['subject'];

   $sfcount++;
  }
}

What do I change to have the last post links point to the topic instead?

Thanks!

2

Re: Have all Last Post links point to Topic instead.

That code appears to be for the subforum mod.

You'd need to changed a darned sight more than just the link. Unless you're a glutton for punishment and rather comfortable with coding, I would recommend you give this idea a wide berth. Besides, the SEO benefit is totally unproven. I personally think they're a complete waste of time in that regard. They're eye candy, nothing more.

Re: Have all Last Post links point to Topic instead.

Hey Matt,

How are you?

So, this would be a bigger job than I thought? I thought about doing it with 301 redirects, but that doesn't look possible because the post urls don't include the topic number.

I keep getting different answers to this question. Should we disallow posts in robots.txt? I think the most common answer is yes, because they are duplicates of the topic urls. The post urls were also excluded from the SEO rewrite mod, and from the xml.sitemap in the sitemap mod. Right now I've been disallowing /forums/p.

What's your opinion? Allow or disallow?

Then I noticed that phpbb came out with a mod adressing this issue, and instead of just disallowing, I think they used 301 redirects to point all last post links to the topic. This way the duplicates are gone, and you don't lose all those internal links.

What do think?

Alex

4

Re: Have all Last Post links point to Topic instead.

Judging by one bit of info I found, do nothing. smile The search engines are smart enough these days to glean what information they need from where they prefer to glean it from.

http://www.theadminzone.com/forums/show … hp?t=54493

Re: Have all Last Post links point to Topic instead.

MattF wrote:

Judging by one bit of info I found, do nothing. smile The search engines are smart enough these days to glean what information they need from where they prefer to glean it from.

http://www.theadminzone.com/forums/show … hp?t=54493


I think I've found the correct answer in the Google Webmaster article on duplicate content. They mention using canonicalization when dealing with duplicates. In this case the best way to do it is not disallow posts in robots.txt, but exclude them from the xml sitemap. Google will then perceive the Topic URL as the preferred URL and index accordingly.

So you're right. The theory behind that phpbb mod is unwarranted.

6 (edited by MattF 2009-07-20 21:48)

Re: Have all Last Post links point to Topic instead.

Aye, that pretty much sums up the general gist of things. smile Provide them with good links as hints, i.e: the sitemap, but leave the classification and general decisions on what to include to their indexing bots.

The only time I've ever redirected or blocked content is when I'm specifically wanting them to view a different version of a page, (printable version over full version, etc.), or when it's a section or portion of the site which they have no need to access. Providing good quality metadata information, useful titles, good quality, valid (x)html and suchlike seems to have far more effect than the likes of worrying about duplicate content or trying to provide fancy URL schemes and suchlike. The indexing bots have had plenty of time to become well adapted to their job by now. big_smile

Re: Have all Last Post links point to Topic instead.

MattF wrote:

Aye, that pretty much sums up the general gist of things. smile Provide them with good links as hints, i.e: the sitemap, but leave the classification and general decisions on what to include to their indexing bots.

The only time I've ever redirected or blocked content is when I'm specifically wanting them to view a different version of a page, (printable version over full version, etc.), or when it's a section or portion of the site which they have no need to access. Providing good quality metadata information, useful titles, good quality, valid (x)html and suchlike seems to have far more effect than the likes of worrying about duplicate content or trying to provide fancy URL schemes and suchlike. The indexing bots have had plenty of time to become well adapted to their job by now. big_smile


Yeah, I'm putting SEO at the top of my list and have everything in pretty good shape. I'm only disallowing irrelevant files and directories. They say you don't want the bots wasting thier time crawling irrelevant files, and I've seen first hand that Yahoo will index stuff like CSS files.

The only thing I don't have perfect is valid HTML. I've done some funky stuff that comes up as invalid on W3C, but it's all cross-browser friendly. I've read that it's kind of irrelvant as long as the bots can read the text and tags. Also, the biggest sites, including Google, have more errors than mine.

Let me ask you something that I just noticed. When you're at say a Topic, and log in to post a reply, my Punbb 1.2* redirects to the index page. That's not happening here, it brings you back to where you were. Is there a fix for that, or is it just an upgrade on 1.3*?

Thanks.

8

Re: Have all Last Post links point to Topic instead.

AlexanderS wrote:

The only thing I don't have perfect is valid HTML. I've done some funky stuff that comes up as invalid on W3C, but it's all cross-browser friendly. I've read that it's kind of irrelvant as long as the bots can read the text and tags. Also, the biggest sites, including Google, have more errors than mine.

Is it possible to post the link to your site? (Or e-mail it direct to me if not?) Very few things other than IE specific code or suchlike are irrepairable. smile Source code validity is something worthwhile working towards, if possible. It has benefits in just about all areas. smile

I know what you mean with the likes of Google and such. It wouldn't be so bad but most of those widgets and such they do either don't work or screw your page validity up too. big_smile Hardly a shining example for standards.


AlexanderS wrote:

Let me ask you something that I just noticed. When you're at say a Topic, and log in to post a reply, my Punbb 1.2* redirects to the index page. That's not happening here, it brings you back to where you were. Is there a fix for that, or is it just an upgrade on 1.3*?

It was a feature added in 1.3. The previous page you visited is stored in the DB, and the redirects use that value instead of just redirecting back to the index and suchlike.

Re: Have all Last Post links point to Topic instead.

MattF wrote:
AlexanderS wrote:

The only thing I don't have perfect is valid HTML. I've done some funky stuff that comes up as invalid on W3C, but it's all cross-browser friendly. I've read that it's kind of irrelvant as long as the bots can read the text and tags. Also, the biggest sites, including Google, have more errors than mine.

Is it possible to post the link to your site? (Or e-mail it direct to me if not?) Very few things other than IE specific code or suchlike are irrepairable. smile Source code validity is something worthwhile working towards, if possible. It has benefits in just about all areas. smile

I know what you mean with the likes of Google and such. It wouldn't be so bad but most of those widgets and such they do either don't work or screw your page validity up too. big_smile Hardly a shining example for standards.


AlexanderS wrote:

Let me ask you something that I just noticed. When you're at say a Topic, and log in to post a reply, my Punbb 1.2* redirects to the index page. That's not happening here, it brings you back to where you were. Is there a fix for that, or is it just an upgrade on 1.3*?

It was a feature added in 1.3. The previous page you visited is stored in the DB, and the redirects use that value instead of just redirecting back to the index and suchlike.


I PMed you my site. Check it out. The thing is that I'm no coder, and it's seems more important for me to get my data installed (it's a drawn out process) at this time so I can get some traffic.

10

Re: Have all Last Post links point to Topic instead.

I'd forgotten the PM mod was installed on here. big_smile Cheers for that. I'll have a look see. smile