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
  #302  
Old 12-27-2003, 10:22 PM
NickRac NickRac is offline
 
Join Date: Nov 2003
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't have a "httpd.conf" file...now what?
Reply With Quote
  #303  
Old 12-30-2003, 01:43 PM
influence influence is offline
 
Join Date: Jan 2002
Location: inside a bullet
Posts: 207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey lierduh or anyone else, after installing this hack, now me and my members can't view threads over 30 days old and I did set all my forums to show threads from the beginning.

Can anyone please help me fix this because google wont be able to index pages that are older than 30 days even though I dont care about that but I want my members to be able to view their old post or bring old posts back up.

Please someone post a fix for this
Reply With Quote
  #304  
Old 01-08-2004, 05:51 PM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone got this working with vB3 RC2 ?

my forum urls are

forumdomain.com/f123/s
forumdomain/t234/s.html

my old rewrite rules for vB 2.3.x were
Code:
RewriteEngine on
RewriteRule ^/f([0-9]+)/?$ /forumdisplay.php?forumid=$1 [L]
RewriteRule ^/f([0-9]+)/s?$ /forumdisplay.php?forumid=$1 [L]
RewriteRule ^/t([0-9]+)\.html$ /showthread.php?threadid=$1 [L]
RewriteRule ^/t([0-9]+)/s([^/]?)\.html$ /showthread.php?threadid=$1&s=$2 [L]
RewriteRule ^/s([^/\?]0-9)+/$ /index.php?s=$1 [L]
and my htaccess file already had the following
Code:
AddType text/x-server-parsed-html .html
AddType text/x-server-parsed-html .htm
Redirect /forums/ http://animeboards.com/index.php
ErrorDocument 404 http://animeboards.com/index.php
ErrorDocument 400 http://animeboards.com/index.php
ErrorDocument 401 /401.php

<Limit GET PUT POST>
order allow,deny
allow from all
deny from .paonline.com
deny from 216.220.160
deny from 216.220.161
deny from 216.220.162
deny from 216.220.163
deny from 216.220.164
deny from 216.220.165
deny from 216.220.166
deny from 216.220.167
deny from 216.220.168
deny from 216.220.169
deny from 216.220.170
deny from 216.220.171
deny from 216.220.172
deny from 216.220.173
deny from 216.220.174
deny from 216.220.175
deny from 12.148.196
deny from 12.148.209
</Limit>
i tried changing forumid and threadid to f= and t= but all i got was redirecting me to my main page..

so i gave up and tried looking for ways to use mod_rewrite to instead redirect to a file with message of the new url location using this code in url.php

PHP Code:
<?php
//break referring url to pieces to get directory path
$refer $_SERVER["HTTP_REFERER"];
$pieces explode("/"$refer);
//break directory path to get forum or thread id value
$refer2 $pieces[3];
$fid substr($refer21);
$tid substr($refer21);

echo 
"This page has moved...<br>";
echo 
"<b>from:</b> ";
echo 
$_SERVER["HTTP_REFERER"];
echo 
"<br>";
echo 
"<b>to: </b>";
if (
$refer2[0] == f) {
echo 
"http://forumdomain.com/forumdisplay.php?f=$fid";
} elseif (
$refer2[0] == t) {
echo 
"http://forumdomain.com/showthread.php?t=$tid";
} else {
// header("Location: http://forumdomain.com/index.php");
echo "error";
}

?>
Which i intended for if the referring url is forumdomain.com/f123/s, i can explode and extract the forum id or thread id. I could change the echo's to PHP header redirects later... but you see what i mean

but problem is if i use mod_rewrite such as

Code:
RewriteEngine on
RewriteRule ^/f([0-9]+)/?$ /url.php [T=application/x-httpd-php,L] 
RewriteRule ^/f([0-9]+)/s?$ /url.php [T=application/x-httpd-php,L]
RewriteRule ^/t([0-9]+)\.html$ /url.php [T=application/x-httpd-php,L]
RewriteRule ^/t([0-9]+)/s([^/]?)\.html$ /url.php [T=application/x-httpd-php,L]
i end up with the referring url as not being http://forumdomain.com/f123/s but as the page which lists that url http://forumdomain.com/f123/s (i.e. search engine listing - it will show search engine's link as referring url)

any ideas ?
Reply With Quote
  #305  
Old 01-08-2004, 06:18 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by eva2000
Anyone got this working with vB3 RC2 ?
I wasn't sure whether I was going to implement the hack on VB3 as I'm less convinced that Google requires it nowadays, and the pain involved (I was *very* thorough in my implementation) when I have to upgrade the forum was too much for me to face (especially when urgent bug fixes came along).

However, it's a very sound theory still and does neaten the whole URL thing.

And because it's you who ask so soon eva2000 I'll look at it when I do my upgrade to VB3.

How comprehensive do we want it?

Last time it was reasonably comprehensive... but do we want to extend it to ALL URL's? Save for the form post ones obviously... just the ones that guests can get to... such as Member Profiles and Calendar entries as well as the Home, Forum, Thread, Post and top level pages.

Maybe this time we can get it all into one nice big (enormous ) install file.

Anyhow... I'll look into it soon... I have to renew my vBulleting subscription first! tsk!

For reference to others... here were the last iteration of the rewrite rules I was using on my server:

Code:
RewriteEngine on

RewriteBase /forum

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

  #
  # showthread.php rewriting
  #
  # t2.html = threadid
  #
RewriteRule ^t([0-9]+)\.html$ showthread.php?threadid=$1 [L]
  #
  # t2-15-2 = threadid + perpage + pagenumber
RewriteRule ^t([0-9]+)-([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=$2&pagenumber=$3 [L]
  #
  # t2-15--friendster--2.html = threadid + perpage + highlight + pagenumber
RewriteRule ^t([0-9]+)-([0-9]+)--(.*)--([0-9]+)\.html$ showthread.php?threadid=$1&perpage=$2&highlight=$3&pagenumber=$4 [L]

  #
  # avatar.php rewriting
  #
  # av1-1053412959.gif = userid + dateline
RewriteRule ^av([0-9]+)-([0-9]+).gif$ avatar.php?userid=$1&dateline=$2 [L]

  #
  # attachment.php rewriting
  #
  # atp157156.gif = postid + extension
RewriteRule ^atp([0-9]+).([a-z]+)$ attachment.php?postid=$1 [L]
  # att157156.gif = attachmentid + extension
RewriteRule ^att([0-9]+).([a-z]+)$ attachment.php?attachmentid=$1 [L]

  #
  # Correcting the page navigation where it is used in other parts of the forum.
  #
RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^memberlist.php$ memberlist.php?%1&pagenumber=%2? [L]
RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^search.php$ search.php?%1&pagenumber=%2? [L]
RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^member.php$ member.php?%1&pagenumber=%2? [L]
RewriteCond %{QUERY_STRING} ^(.*)-([0-9]+)\.html$
RewriteRule ^member2.php$ member2.php?%1&pagenumber=%2? [L]
As you may notice, I did attachments and avatars too, to assist proxies (specifically old AOL ones using HTTP1.0) in caching them... which prevents at least some bandwidth loss and database hits.

I was putting the datestamp of the avatar in the avatar URL so that each upload of a custom avatar would result in a unique URL

Anyway... I'll look at the VB3 possibilities once I get my license and a copy of the code... which should be in a week or two

Cheers

David K
Reply With Quote
  #306  
Old 01-08-2004, 11:19 PM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks David.. i think to keep it simple to forum and thread links

forumdomain.com/f123/s
forumdomain/t234/s.html

i don't even mind if these redirect to the real longer url, just as long as they point to the respective forum id or thread id to keep my in-forum post referenced links valid (otherwise members who posted links using shorter urls in their past posts would all be invalid)
Reply With Quote
  #307  
Old 01-09-2004, 04:13 AM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's even easier then

I'll knock up something that does redirects so that your existing links in posts aren't broken

I'll try and do that this weekend... and that bit should be possible without the codebase
Reply With Quote
  #308  
Old 01-11-2004, 10:16 AM
lierduh lierduh is offline
 
Join Date: Jan 2003
Location: Sydney, Australia
Posts: 459
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by eva2000
Anyone got this working with vB3 RC2 ?

my forum urls are

forumdomain.com/f123/s
forumdomain/t234/s.html

my old rewrite rules for vB 2.3.x were
Code:
RewriteEngine on
RewriteRule ^/f([0-9]+)/?$ /forumdisplay.php?forumid=$1 [L]
RewriteRule ^/f([0-9]+)/s?$ /forumdisplay.php?forumid=$1 [L]
RewriteRule ^/t([0-9]+)\.html$ /showthread.php?threadid=$1 [L]
RewriteRule ^/t([0-9]+)/s([^/]?)\.html$ /showthread.php?threadid=$1&s=$2 [L]
RewriteRule ^/s([^/\?]0-9)+/$ /index.php?s=$1 [L]
any ideas ?
Bear in mind, the forumid= and threadid= url still work despite vB3 are using the short version as "f=" and "t=". So theoretically you don't even need to change your rules.

You might like to enable the rewrite log to debug the problem. I have an example at:

http://www.vbulletin.com/forum/showp...7&postcount=89

My current rulesets for the legacy links are posted here:

https://vborg.vbsupport.ru/showpost....&postcount=298

They have worked for me since beta 7, then Gamma, now RC2.

Also, if you disable the error redirects, I might be able to work out the problem if you provide a sample link.

For other people who is looking at doing this hack, I can't think of a reason to implement this hack in vB3. Just kill the session id in seesions.php, the bots will index the pages. Make sure to include a robots.txt file to exclude member.php etc!!!
Reply With Quote
  #309  
Old 01-23-2004, 02:54 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by eva2000
thanks David.. i think to keep it simple to forum and thread links

forumdomain.com/f123/s
forumdomain/t234/s.html

i don't even mind if these redirect to the real longer url, just as long as they point to the respective forum id or thread id to keep my in-forum post referenced links valid (otherwise members who posted links using shorter urls in their past posts would all be invalid)
OK, this is for eva2000 and then I'll go through what I'm doing to keep all my links lovely

In your forum directory, set up your .htaccess to contain the following:
Code:
RewriteRule ^f([0-9]+)\/s$ forumdisplay.php?f=$1 [R=301]
RewriteRule ^t([0-9]+)\/s\.html$ forumdisplay.php?f=$1 [R=301]
Let me explain each part of those rules... well... one of them:

RewriteRule ARG1 ARG2 ARG3= If the URL requested matches the first arg, perform the second arg accord to the rules of the final arg.

ARG1 = Regular expression to match. In our case, ^f([0-9+])\/s$ where ^ = start of line, ([0-9]+ ) = 1 or more numbers, \/ = escaped forward slash (has to be escaped within a regexp), $ = end of line.

ARG2 = URL to request instead. In our case we also include $1 which is the first matching part of the regexp in ARG1 which is the number... the forumId.

ARG3 = Rule to dictate how to handle the ARG2 URL... [L] would bring it inline (leave the browser URL as it is and force the URL to the output stream without redirect)... I'm using [R=301] which is to send back a http 301 error which is "Moved Permanently"... I do this as I want Google and search engines to update all of their links over time and quite hitting the legacy ones.

So that's your solution eva Though do bug me if I screwed that up... I've only just finally got round to it... and the 301 error may require a fully qualified URL and not a relative one.



Anyhow... this is now to help the people who are NOT upgrading their VB2 but, are doing a fresh install of VB3 at a new URL and are archiving their VB2. I'm not sure how many of these there will be... but our forum quite enjoys the zest of occassional re-births... and it will help to ensure that our VB3 threads are truly threaded from day 1.

So... I've got this URL at the moment:

http://www.bowlie.com/forum/

And I'm moving that forum to:

http://www.bowlie.com/2003/

And putting VB3 on the /forum/ URL.

Yes I have lots of VB licenses

Anyhow... I want all t*.html links to go through to the archived forum... to keep all of the search engine results valid.

And I want all of the f*.html links to go through to the new forums on the new board.

The threads are easy to map:

Code:
	#
	# Legacy thread redirects
	#
RewriteRule ^t([0-9]+)\.html$ http://www.bowlie.com/forum/showthread.php?threadid=$1 [R=301]
RewriteRule ^t([0-9]+)-([0-9]+)-([0-9]+)\.html$ http://www.bowlie.com/forum/showthread.php?threadid=$1&perpage=$2&pagenumber=$3 [R=301]
RewriteRule ^t([0-9]+)-([0-9]+)--(.*)--([0-9]+)\.html$ http://www.bowlie.com/forum/showthread.php?threadid=$1&perpage=$2&highlight=$3&pagenumber=$4 [R=301]
But the forums are harder.

The forumid's on both the old and new sites are different... so what was forumid = 4 on VB2 is now forumid = 11 on VB3. So I need a map to track these and then set up all of the RewriteRules.

I've created a javascript array of the forumids... where the first value is the VB2 forumid, and the second value is the VB3 forumid.

Some forums won't exist on my VB3 site... so those links will go through to the archive too.

I've then created a simple bit of JavaScript which when run from Internet Explorer (doesn't work in Mozilla as that is standards compliant ) will produce my rewriterules for me:

Code:
<script type="text/javascript">
var forums = new Array(
  new Array('16','21'),
  new Array('17','22'),
  new Array('29',''),
  new Array('33','29'),
  new Array('4','11'),
  new Array('30',''),
  new Array('27','')
);

var html = "";

var oldForumUrl = "http://www.bowlie.com/2001/";
var newForumUrl = "http://www.bowlie.com/forum/";

for (var ii = 0; ii < forums.length; ii++) {
  if (forums[ii][1] == '') {
    // Link to archive
		html += "RewriteRule ^f" + forums[ii][0] + "\\.html$ " + oldForumUrl + "forumdisplay.php?f=" + forums[ii][0] + " [R=301]\n";
    html += "RewriteRule ^f" + forums[ii][0] + "--.*\\.html$ " + oldForumUrl + "forumdisplay.php?f=" + forums[ii][0] + " [R=301]\n";
  } else {
    // Link to new
		html += "RewriteRule ^f" + forums[ii][0] + "\\.html$ " + newForumUrl + "forumdisplay.php?f=" + forums[ii][1] + " [R=301]\n";
    html += "RewriteRule ^f" + forums[ii][0] + "--.*\\.html$ " + newForumUrl + "forumdisplay.php?f=" + forums[ii][1] + " [R=301]\n";
  }
}

document.write("<plaintext>" + html);

</script>
Obviously modify the URLs as applicable to you.

The output can then be pasted into your .htaccess and you will have:

Legacy forum URLs for forums that exist on your new VB going to VB3
Legacy forum URLs for forums that don't exist on your new VB going to VB2
Legacy thread URLs going to your VB2

Google would start spidering your new VB3 links pretty soon, including the new thread ones.

Now... if all of that went straight over your head... just ignore it and don't do any of it It's there to help other users that like me have installed this hack widely, indexed heavily by Google and are choosing to have a fresh VB3 and archive their VB2... that may be no-one else here... in which case... ignore this
Reply With Quote
  #310  
Old 01-29-2004, 03:50 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't own my own server yet, But my question is. does the the .htaccess file and httpd.conf file exsit on each domain registered on the server, or just one file alone for all domain being hosted by the provider? www.computerproblems.org is the site im refering to.
Reply With Quote
  #311  
Old 01-29-2004, 03:53 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

http.conf is used for the global Apache configuration, this file only occurs once, you can specify per domain options in the relevent sections too. .htaccess is used for per directory (and any sub directory) options, so if placed in public_html (or similar) should effect the whole site unless another directory overrides the config.
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 03:53 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.05485 seconds
  • Memory Usage 2,348KB
  • Queries Executed 25 (?)
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
  • (8)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (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_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