Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by fastforward fastforward is offline
Developer Last Online: Nov 2011 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-24-2001 Last Update: Never Installs: 35
 
No support by the author.

For vB 2.0

This little hackette is a quick fix to allow search engine bots to spider your threads.

Although this will allow the bots to index every thread on your site, it will not make the threads 'search engine optimized'. They will see exactly what you see when you visit your site. It simply removes the CGI bits from the URL's which prevents most search engine bots from spidering more than one level deep.

If you want a hack that allows to fully customize how the thread will look to the search engine bot, you should look at Overgrows more complete hack here.

The advantage of this hack over Overgrows is that it does not require htaccess support which can have performance issues. This could also be seen as a disadvantage though as my hack requires that you have mod_rewrite enabled on your Apache Server, whereas Overgrows method should work with just about any web host out there.

Take yer pick

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #262  
Old 04-07-2003, 02:51 PM
amk35 amk35 is offline
 
Join Date: Nov 2001
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lierduh,

Thanks for the response

At
http://domain.com/forums/f1.html

The links on the bottom to view older threads are as follows:

2 - http://domain.com/forums/forumdispla...page=40-2.html

3 - http://domain.com/forums/forumdispla...page=40-3.html

etc. All bring up the same initial forum page when clicked

My rewrite rules are:

RewriteEngine on
RewriteRule ^/forums/f([0-9]+)/?$ /forums/forumdisplay.php?forumid=$1 [L]
RewriteRule ^/forums/f([0-9]+)\.html$ /forums/forumdisplay.php?forumid=$1 [L]
RewriteRule ^/forums/f([0-9]+)-([0-9]+)\.html$ /forums/forumdisplay.php?forumid=$1&daysprune=1000&sortord er=&sortfield=lastpost&perpage=25&pagenumber=$2 [L]
RewriteRule ^/forums/t([0-9]+)\.html$ /forums/showthread.php?threadid=$1 [L]
RewriteRule ^/forums/t([0-9]+)-([0-9]+)-([0-9]+)\.html$ /forums/showthread.php?threadid=$1&perpage=$2&pagenumber=$ 3 [L]
RewriteRule ^/forums/t([0-9]+)-([0-9]+)--(.*)--([0-9]+)\.html$ /forums/showthread.php?threadid=$1&perpage=$2&highlight=$3 &pagenumber=$4 [L]

RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^/forums/memberlist.php$ /forums/memberlist.php?%1&pagenumber=%2? [L]
RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^/forums/search.php$ /forums/search.php?%1&pagenumber=%2? [L]



Thanks for any help. BTW, I have no problem paying you for fixing it either I just need to get it working quickly. Thanks.

Allen
Reply With Quote
  #263  
Old 04-09-2003, 11:16 AM
lierduh lierduh is offline
 
Join Date: Jan 2003
Location: Sydney, Australia
Posts: 459
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like you have not edited the php file.

==== >8
open forumdisplay.php

Find
$pagenav =
getpagenav($totalthreads,"forumdisplay.php?s=$sess ion[sessionhash]&forumid=$forumid&daysprune=$daysprune&sortorder=$ sortorder&sortfield=$sortfield&perpage=$perpage");

replace it with:
$pagenav = getpagenav($totalthreads,"f$forumid");
====== >8

You need to find the php file (forumdisplay.php) and edit it according to my original post. You can put "//" without the quote in front of that line to comment out the old code and add the line of new code next line to it.

I will try to come back to this forum soon to see if you have fixed it. Thanks but no, I will not accept payment for something like this.
Reply With Quote
  #264  
Old 04-11-2003, 01:59 AM
tpearl5's Avatar
tpearl5 tpearl5 is offline
 
Join Date: Nov 2001
Location: PA
Posts: 1,014
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I changed servers again and unfortunately I can't get this hack working. The server has ensim on the backend running redhat. In the .htaccess I have:

PHP Code:
RewriteEngine on 
RewriteRule 
^f([0-9]+)/?$ /forumdisplay.php?forumid=$1&s=$[L
RewriteRule ^t([0-9]+).html$ /showthread.php?threadid=$[L]
RewriteRule ^t([0-9]+)-([0-9]+).html$ /showthread.php?threadid=$1&perpage=15&pagenumber=$[L]
RewriteRule ^f([0-9]+)-([0-9]+)/$ /forumdisplay.php?forumid=$1&daysprune=1000&sortorder=&sortfield=lastpost&perpage=40&pagenumber=$[L]
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$[L
However this causes a forbidden message on all directory pages. It does not however effect http://board.midibuddy.net .. (the page still loads)

The board pages are at http://board.midibuddy.net

Please help! What could I possibly be doing wrong?
Reply With Quote
  #265  
Old 04-13-2003, 01:19 PM
amk35 amk35 is offline
 
Join Date: Nov 2001
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lierduh,

Thanks very much. such a stupid oversight....works great now.
Reply With Quote
  #266  
Old 04-30-2003, 04:15 PM
MarkG MarkG is offline
 
Join Date: Nov 2001
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i've moved to a new server and this code doesnt work anymore for some reason

if it you can get it working either here's another way:

1) set a 404.php as your 404 handler in your .htacess or httpd.conf
Code:
ErrorDocument 404 /404.php
and put this in
Code:
<?
ob_start();
if ($ref=="") $ref=$REQUEST_URI;
if (preg_match ("#/forums/t\d*-s.html#",$ref)) {
        $ref=str_replace("/forums/t","",$ref);
        $ref=str_replace("-s.html","",$ref);
        Header("Location: http://domain.com/forums/showthread.php?threadid=".$ref );
}
if (preg_match ("#/forums/f\d*-s.html#",$ref)) {
        $ref=str_replace("/forums/f","",$ref); 
        $ref=str_replace("-s.html","",$ref);
        Header("Location: http://domain.com/forums/forumdisplay.php?forumid=".$ref );      
}
ob_end_clean();
?>
important: my forums are under /forums and i have my links like t4444-s.html not t4444/s555555.html (with a - not / and without the session number). change the code according to your situation

if anyone uses it, let me know if it works for you

ps. there one issue with this sollution: you still get a line in your error log about a missing file...
Reply With Quote
  #267  
Old 06-25-2003, 08:09 AM
Slynderdale Slynderdale is offline
 
Join Date: Mar 2002
Location: New York State
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a .htaccess version of this? I tried the rewrite rule in the first post and got a 500 internal error.
Reply With Quote
  #268  
Old 07-13-2003, 01:15 PM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't get behind that mod_rewrite stuff

Could someone try to explaine what i should add to my .htaccess when i want to redirect:

http://www.mydomain.com/pages/index?firma=john borne
or
http://www.mydomain.com/pages/index?firma=iwonttellyou

to

http://www.mydomain.com/pages/john borne
or
http://www.mydomain.com/pages/iwonttellyou

??

thx in advance
Reply With Quote
  #269  
Old 07-16-2003, 05:31 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using Google AdSense to pay for my forum, and the side effect of having the ads on the site is that they send thousands of spiders to try and figure out what is going on and what contextual adverts to place.

So... to this thread I came.

Big thanks to fastforward and lierduh for all their work.

But... I have found a couple of small bugs... most of them I've ironed out (unfortunately they were painful to find so it took a while and I can't recall every little thing I've done)... but there is one that is lingering:

In forumdisplay.php, when I'm viewing a forum:
http://www.bowlie.com/forum/f2.html

If I sort the forum by the number of thread replies. It's fine.
But then if I page onto the second page of the results... it's forgotten that I wanted it sorted.

A user pointed this out to me... but in essence... forum sorting doesn't work under this system.

I'll try and figure it out myself, but I feel I'm not as versed in mod-rewrite and the subtleties as others here... so anyone who can help, please do
Reply With Quote
  #270  
Old 07-16-2003, 06:19 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, got it working again...

Here's the modification I made:

In forumdisplay.php lierduh changed:
PHP Code:
$pagenav getpagenav($totalthreads,"forumdisplay.php?s=$session[sessionhash]&forumid=$forumid&daysprune=$daysprune&sortorder=$sortorder&sortfield=$sortfield&perpage=$perpage 
To:
PHP Code:
$pagenav getpagenav($totalthreads,"f$forumid"); 
And I've now changed it to:
PHP Code:
$pagenav getpagenav($totalthreads,"f$forumid--$daysprune--$sortfield--$sortorder"); 
Now... none of that is going to work without the rewrite rules... so I've added two more... but here are all the ones I have that relate to the forumdisplay.php file. Note that the first one is lierduh's original one:

Code:
  #
  # forumdisplay.php rewriting
  #
  # f2.html = forumid
RewriteRule ^f([0-9]+)\.html$ forumdisplay.php?forumid=$1 [L]
  #
  # f2--25--lastpost---2.html = forumid + daysprune + sortfield + sortorder + pagenumber
RewriteRule ^f([0-9]+)--([0-9]+)--([a-z]+)---([0-9]+)\.html$ forumdisplay.php?forumid=$1&daysprune=$2&sortorder=&sortfield=$3&perpage=25&pagenumber=$4 [L]
  #
  # f2--25--lastpost--asc-2.html = forumid + daysprune + sortfield + sortorder + pagenumber
RewriteRule ^f([0-9]+)--([0-9]+)--([a-z]+)--([a-z]+)-([0-9]+)\.html$ forumdisplay.php?forumid=$1&daysprune=$2&sortorder=$4&sortfield=$3&perpage=25&pagenumber=$5 [L]
Now all of the ordering stuff works on the page spanning, and the page spanning is easy to spider
Reply With Quote
  #271  
Old 07-16-2003, 06:27 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just checked, and lierduh you also suffer from this bug... so I'll assume that everyone who has done this also suffers from it.

The change I've made isn't aesthetically pleasing, but it does work and stays true to the spider friendly purpose.

To summarise to those joining the end of this thread and wondering where to begin:

First, follow fastforward's instructions on the first page of this thread... you need to do this before anything else to be familiar with what is going on before it gets scarier:

https://vborg.vbsupport.ru/showthrea...threadid=18035

Then follow lierduh's instructions within his post... there are several major improvements over the initial code.

https://vborg.vbsupport.ru/showthrea...137#post348137

If you're confident at this point and everything is working, then go through the whole codebase and replacing the relevant forumdisplay and showthread parts with the new format... stripping out sessionhashes as you go along (I've disabled the option in user prefs to not use cookies and made cookies compulsory).

Finally... to resolve the nagging bug about sorting and page spanning, do the stuff in my post above:

https://vborg.vbsupport.ru/showthrea...256#post418256

It's a lot of work, and certainly daunting. Would I attempt it if I were seriously unsure about this stuff? Nope. But if you are comfortable working with the template system and editing the php files... then the benefits of being spidered are considerable and can do a lot for your forum (increase members or increase advert revenue).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:02 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04650 seconds
  • Memory Usage 2,344KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete