vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Spider friendly URLs (https://vborg.vbsupport.ru/showthread.php?t=18035)

Ogmuk 07-23-2003 04:47 PM

Thanks! I didn't even think about excluding the placeholding banners to raise the clickthrough percentage. Simple but great javascript.

lierduh 07-25-2003 02:16 PM

Quote:

07-17-03 at 06:27 AM buro9 said this in Post #270
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:

...
.

buro9, I have edited my original post to include a link pointing to your post.

I might start to look into fixing the bugs you pointed out, only problem (or not for some) is the VB3 is around the corner...:)

PurpleCow 08-01-2003 01:34 PM

If my forums are installed in a subdomain say http://forums.mydomaindomain.com and not the root or a subdirectory like this http://www.mydomain.com/forums , how do i proceed ??

Any special changes to be made ??

Thanks

lierduh 08-02-2003 03:54 AM

Quote:

Today at 01:34 AM HostBubble said this in Post #283
If my forums are installed in a subdomain say http://forums.mydomaindomain.com and not the root or a subdirectory like this http://www.mydomain.com/forums , how do i proceed ??

Any special changes to be made ??

Thanks

Looks like you have not RTFM.:)

heynurse 08-17-2003 06:04 PM

What an awesome hack and additional features added! Great job.

I was just thinking, would it be beneficial to your search engine listing to have maybe a keyword in the file name? For example instead of

http://yoursite.com/t24232.html

it could be something like:
http://yoursite.com/XXXXXXX-24232.html (replace XXXX with any keyword you wish.

I'm not too sure how beneficial this might be for rankings, but I've seen it mentioned several times that having keywords in file names is better for rankings? Would this be hard to do or practical? Do you think it would be beneficial?

Or maybe even pulling in the title of the thread into the file name?

Maybe I'm totally off base here and don't have a clue of what I'm talking about :) If so, just tell me so.

Till 08-23-2003 02:36 PM

Quote:

RewriteRule: cannot compile regular expression '^/f([0-9]+)/s([^/]+?)$'
Is all I get. Does that mean I am missing regex support in my mod_rewrite?

Till 08-23-2003 03:12 PM

Nevermind, if anyone is looking for a fix:
https://vborg.vbsupport.ru/showthrea...131#post190131

:D

Could someone (ehem, moderators) edit this and put the link to the post in the first post? ;)

iceman11111 08-26-2003 11:00 PM

Ok, I have everything working but I have 1 question?

If you goto this thread:
http://www.intense-training.com/forums/t3457.html

and then goto the top of the page and click "General Discussion Board"

it goes to
http://www.intense-training.com/foru...hp3?forumid=12

instead of
http://www.intense-training.com/forums/f12.html


How can I fix that?

iceman11111 08-27-2003 01:36 PM

bump for help!

buro9 08-28-2003 04:33 AM

You can only resolve that by editing the PHP code.

Most of the links that are constructed use the templates... which you've already adjusted... but some use the PHP functions to generate the links... such as the pagination and bread crumb navigation bits.

I don't recall the precise change I did to have mine working... but you can emulate what I did by simply searching all of your PHP files for "forumdisplay" and then making the judgement call as to whether you should change that instance of it.

I think you're likely to find that bit in admin/functions.php though ;)

MrNase 10-12-2003 08:00 AM

does this work for 2.3.2 without problems?

i need a .htaccess Version that works with 2.3.2. Please help me :(

mottokrosh 10-20-2003 09:00 AM

Hey guys,

Having gone through this thread from the beginning to establish the definitive hack installation, the mention of vb3 caught my eye.

Will vb3 have spider-friendly URLs by default? If so, when is it coming out, any ideas? Is it possible to download a beta?

M.

gmarik 11-11-2003 02:27 PM

Does this works for:
1) 2.3.2
2) vB3 beta 7 ?

buro9 11-11-2003 05:13 PM

Quote:

Originally Posted by gmarik
Does this works for:
1) 2.3.2

yes
Quote:

Originally Posted by gmarik
2) vB3 beta 7 ?

not with these precise instructions, but you could adjust it to make it work on any website... the reliance is an mod_rewrite and not any particular code underneath.

but being cautious... i'd say don't do this until VB gets out of beta... they'd be too many releases and too much pain re-implementing on each version in between

PurpleCow 12-09-2003 04:56 AM

hello,

I am using this hack, ... lierduh's instructions in this post https://vborg.vbsupport.ru/showpost....&postcount=223 and its is working fine with some minor problems.

I have teh done exactly the same as you specified in that post excepting this change as i could not find that code in my online.php

Quote:

In online.php, find:

$loc=preg_replace("/\?s=[a-z0-9]{32}(&)?/","?",$loc);

add the following lines:

$loc=preg_replace("/f(\d+).html/","forumdisplay.php?forumid=\$1",$loc);
$loc=preg_replace("/t(\d+).html/","showthread.php?threadid=\$1",$loc);
$loc=preg_replace("/t(\d+)-(\d+)-(\d+).html/","showthread.php?threadid=\$1",$loc);
Now the problem is, the multi page navigation.

Please check this page : http://hostmarket.hostbubble.com/f22.html

It does show the multiple pages, but when i clcik on the second page, it shows all the threads and there is no links at the bottom for next or previous page. What wrong have i done.

My forum is here : http://hostmarket.hostbubble.com

Thanks much for any help
Cheers

PurpleCow 12-09-2003 06:19 AM

Okay, I think, i have solved the above mentioned problem and works fine.
However, i'll have to say that, what works on my forum is :

for multi page nav - this is the urls : t3-5.html and not of this type t3-15-5.html ... and actually this t3-5.html works fine. Is that okay and should not have any other problems ???

Okay, another request though :

is it possible to convert the forum jump url's and page navigation urls ( Marketplace > HostBubble Lounge > Suggestions & Feedback ) also to static using lierduh instructions and buro9 instructions.

Thanks much

iceman11111 12-11-2003 08:38 PM

Help, found a little problem

When I try and Update my counters I get a error for:

Update Thread Info


Database error in vBulletin Control Panel 2.2.9:

Invalid SQL: UPDATE thread SET lastpost=1055471230,replycount=9,postusername='tla ne', postuserid='2575', lastposter='GYMBRAT',attach= WHERE threadid=1999
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE threadid=1999' at line 1

mysql error number: 1064

Date: Thursday 11th of December 2003 03:38:08 PM
Script: http://www.intense-training.com/foru...dmin/misc.php3
Referer: http://www.intense-training.com/foru...ion=chooser&s=



Thanks
iceman

lierduh 12-13-2003 12:02 AM

Quote:

Originally Posted by gmarik
Does this works for:

2) vB3 beta 7 ?

With the Beta 7, I have dropped the whole idea. There is too much to modify. I have adopted the easy way out: Kill the seesion ID, and be done with it.

Without the session ID, Googles etc will index the forums. Find sessions.php under includes. Note the codes already include disabling session ID for Googles. What I have done is:

diff sessions.php~ sessions.php
PHP Code:

380,381c380,381
< if ($nosessionhash == OR preg_match("#(google|slurp@inktomi)#si"$_SERVER['HTTP_USER_AGENT']))
< { 
// if user is working through cookies, blank out the sessionhash
---
//if ($nosessionhash == 1 OR preg_match("#(google|slurp@inktomi)#si", $_SERVER['HTTP_USER_AGENT']))
//{ // if user is working through cookies, blank out the sessionhash
385c385
< }
---
/*}
392c392

---
> */ 

Basically I completely disabled the session ID. So the forums can be indexed by any search engine. So far no member has complained that cookies-on is the only way to use the board.

With forums used my rewriterules. It is essential to modify the rewriterules so that an old link to the f123.html etc still works, search engine will have your old URL for the forums and threads, you need to make sure they work. I have:

Code:

RewriteEngine on

RewriteRule ^f([0-9]+)\.html$ forumdisplay.php?f=$1 [L]
RewriteRule ^f([0-9]+)-([0-9]+)\.html$ forumdisplay.php?f=$1&page=$2&sort=lastpost&order=&pp=25&daysprune=1000 [L]
RewriteRule ^t([0-9]+)\.html$ showthread.php?t=$1 [L]
RewriteRule ^t([0-9]+)-([0-9]+)-([0-9]+)\.html$ showthread.php?t=$1&pp=$2&page=$3 [L]


lierduh 12-19-2003 09:34 AM

I have noticed Google does not index the archive pages. Probably the contents of the url after the "index.php/" are ignored by Google. I have made a rewrite rule trying to overcome this.

RewriteRule ^arc/(.*)$ archive/index.php/$1 [L]

All I need to do is including the above to my existing rules, and find "footer" template, change "archive/index.php/" to "arc/".

Nothing else needs to be changed.

The actual url for Google to see will be:

http://www.mysite.com/arc/f-40

etc. Now if Google does not index this, I don't know what would they index.:)

(I am using v3 Gamma at the moment).

gmarik 12-25-2003 07:44 AM

I'm been hacking vB2 for quite a long time (about two years), but still I could not figure out all about the re-write function that some vb board use. And now with vb3 Gamma things have changed. What I could really use would be:



1) every forum (forumdisplay.php?f=55, for example) has another field called "description", let's say "sport", for example.

2) every subforum can be called as /forums/sport and it goes right to it, with no ".php?f=" between them

3) it should be as an on/off option admin could choose from



Respect, Marco

NickRac 12-27-2003 10:22 PM

I don't have a "httpd.conf" file...now what?

influence 12-30-2003 01:43 PM

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

eva2000 01-08-2004 05:51 PM

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 ?

buro9 01-08-2004 06:18 PM

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

eva2000 01-08-2004 11:19 PM

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)

buro9 01-09-2004 04:13 AM

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 :)

lierduh 01-11-2004 10:16 AM

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

buro9 01-23-2004 02:54 PM

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 ;)

Logikos 01-29-2004 03:50 PM

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.

NTLDR 01-29-2004 03:53 PM

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.

Logikos 01-29-2004 08:53 PM

Thanks, can this hack be used with just moding the .htaccess file only?

NTLDR 01-29-2004 09:26 PM

I'm pretty sure it can, but I've never used it.

Logikos 01-29-2004 10:33 PM

Anyone know how we would be able to use this with just the .htaccess file? I would love to have this hack on my boards, been seeing some great responds.

iceman11111 02-04-2004 11:26 PM

Help!!!

I have installed all of the additions to this great hack, but I have one major problem!

When I goto Update my counters, I get a an error, trying to "Update Thread Info"

I get this

Database error in vBulletin Control Panel 2.2.9:

Invalid SQL: UPDATE thread SET lastpost=1055471230,replycount=9,postusername='tla ne', postuserid='2575', lastposter='GYMBRAT',attach= WHERE threadid=1999
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE threadid=1999' at line 1

mysql error number: 1064

Date: Wednesday 04th of February 2004 06:26:13 PM
Script: http://www.intense-training.com/foru...dmin/misc.php3
Referer: http://www.intense-training.com/foru...ction=chooser&

eva2000 03-12-2004 12:12 PM

Quote:

Originally Posted by buro9
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 ;)

thanks buro9, sorry for the late reply my forum's server was down due to hardware failure since Jan 31 :o

gmarik 03-12-2004 03:26 PM

This one would be good for vB3 ...

Haakon 04-20-2004 08:41 AM

I agree, I really miss this hack. 300 extra guests are allways welcome you know ;), ANYONE successfully implemented this hack on vb3?

DenzoForums 04-21-2004 04:35 PM

This looks cool.. I would like to install tis for VB 3.0.1. when or if it's available.

Dave

lierduh 04-21-2004 11:46 PM

Please understand, there is no need for VB3 to have this hack.

The Archive system is designed to feed the robots. Besides the main forums are indexed by Googles etc due to the removal of session ID from the URL. The script detects spiders by its user agent and disables the session ID if found.

If anything, one might want to shorten the Archive's URL to potentially increase the ranking. eg.

/archive/index.php/f-35.html

to

/arc/f-35.html

This can be easily achieved by using rewrites.

DenzoForums 04-21-2004 11:56 PM

My archives are not working.. not vbulletin problem, but apparently the sever i am hosted on doesn;t support some feature for that to work. Is there anything else i can do?


All times are GMT. The time now is 06:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01752 seconds
  • Memory Usage 1,946KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (12)bbcode_code_printable
  • (2)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete