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)

jon2x 06-21-2002 04:37 PM

<waffle>
just a thought....
by replacing:
Code:

<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">
with
Code:

<a href="$bburl/t$thread[threadid].html">
i believe you're preventing the sessionhash from being moved direct between pages?... does this affect users who aren't using cookies to track their sessionhash?

if two users with the same browser behind the same proxy and without cookies enabled try to access the site they might get strange things happening like posts being marked as read that they haven't seen etc....

if this is the case i don't think there's a way around it because passing the sessionhash in the path_info might cause spiders from different ips to register multiple copies of the same page...

sorry if i'm missing the point of sessionhash or the way this hack works :paranoid:
</waffle>

The Piper 06-21-2002 05:01 PM

By reading your post I got kinda worried about this as well. But I just checked the "Who's Online" page on my site, and all of the pages are something like:

Code:

http://www.pinkfloydfan.net/t145.html?s=SESSIONHASH
So, apparently, the sessionhash is being passed through the new search-engine friendly page.

BTW, I just tried to update my online.php file with the instructions I found earlier (and posted on the compilation file before), but it didn't work. I was supposed to find this:
Code:

$loc=preg_replace("/?s=[a-z0-9]{32}(&)?/","?",$loc);
But only found this, on 2.2.6:
Code:

$loc=preg_replace("/\?s=[a-z0-9]{32}(&)?/","?",$loc);
I've tried adding
Code:

$loc=preg_replace("/(f)([0-9]+)(/)/","forumdisplay.php?forumid=\2",$loc);
$loc=preg_replace("/(t)([0-9]+)(.html)/","showthread.php?threadid=\2",$loc);
$loc=preg_replace("/&s=[a-z0-9]+/","",$loc);

but then I got lots of errors. No idea of what is going on.... :(

jon2x 06-21-2002 05:13 PM

when i go to your site (http://www.pinkfloydfan.net/) none of the links on the frontpage are actually in the "spider friendly" format... how are the searchengine spiders working? :confused:

The Piper 06-21-2002 05:34 PM

Actually, some of them are in spider-friendly version. Some of them are not, YET, because of a few things: First, I want some of the forums to be shown ordered by Thread in ascendant order, so that can't be accomplished yet with spider-friendly URLS. Second, a few of the regular links (such as those "Comments" on every news) don't need to be SE optimized, because I have the link to the news forum in a SE friendly format, on the left menu.

eva2000 07-06-2002 03:00 PM

hi long time no see :)

i installed the hack and working fine but moving servers from RH 6.2 apache 1.3.26 to RH 7.3 1.3.26 i'm getting an error when i restart apache

i have in my virtualHost directive

RewriteEngine on
RewriteRule ^/f([0-9]+)/s([^/]+?)$ /forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^/t([0-9]+)/s([^/]+?)\.html$ /showthread.php?threadid=$1&s=$2 [L]
RewriteRule ^/s([^/])+?/$ /index.php?s=$1 [L]

and get this error in restarting apache ?

Syntax error on line 1688 of /usr/local/apache/conf/httpd.conf:
RewriteRule: cannot compile regular expression '^/f([0-9]+)/s([^/]+?)$'

my current forum urls are set as

http://animeboards.com/f1/s
http://animeboards.com/t42538/s.html

hoping you can help me :)

eva2000 07-09-2002 12:42 PM

got it to work now with this
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]


SpiceGirl 07-29-2002 02:51 PM

ok, one final time please? can someone post the EXACT steps? of course, only putting some code in the .htaccess (the rewriteEngine stuff) wont do jack. we need to edit our .php files as well, right?

so which ones to edit? where? how?

thanks in advance!

fastforward 07-29-2002 05:15 PM

Quote:

Originally posted by SpiceGirl
ok, one final time please? can someone post the EXACT steps? of course, only putting some code in the .htaccess (the rewriteEngine stuff) wont do jack. we need to edit our .php files as well, right?

so which ones to edit? where? how?

thanks in advance!

Here's the steps:
  1. Edit httpd.conf and use Eva2000's latest rules: ie.
    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]

  2. Add the following line to your 'Head Insert' template:
    Code:

    <base href="$bburl">
  3. Edit the following templates:
    forumdisplay_forumbit_level1_nopost
    forumdisplay_forumbit_level1_post
    forumdisplay_forumbit_level2_nopost
    forumdisplay_forumbit_level2_post
    forumhome_forumbit_level1_nopost
    forumhome_forumbit_level1_post
    forumhome_forumbit_level2_nopost
    forumhome_forumbit_level2_post
    Code:

    Change the links to look like this:
    <a href="$bburl/f$forum[forumid]/s$session[sessionhash]">$forum[title]</a>

  4. Edit the following template:
    forumdisplaybit
    Code:

    Change the links to look like this:
    <a href="$bburl/t$thread[threadid]/s$session[sessionhash].html">$thread[title]</a>

If you have problems with missing images in Netscape, you should go though all templates and edit the links to images to include the full path, ie' $bburl/{images_folder}/a.gif. You can use the template search function for this.

This will spider the first page of all threads only. In most cases, this should be more than enough. It is possible to add support for multipage threads, but this requires editing the code and it will probably change from version to version of vB. If you really need this, there are posts in this thread that discuss it.

I personally use the basic method. It's given me 71,800 entries in Googe for dbforums.com and 47,500 for britishexpats.com.

tpearl5 07-29-2002 09:25 PM

The only problem I'm having is with online.php displaying unknown locations. I tried the code posted here, but got errors. I'm running 2.2.5. Anyone ?]

Take a look: http://degster.com/midi/board/

nuno 10-06-2002 11:05 PM

Paul, how do we fix the Unknown Location Fields showing up in WOL page?
TIA :)

fastforward 10-06-2002 11:17 PM

Quote:

Originally posted by nuno
Paul, how do we fix the Unknown Location Fields showing up in WOL page?
TIA :)

easypeasy :)
In online.php : Change the 'default' block of the CASE statement on or around line 626 to look like this:
Code:

  default:
    if (preg_match ("/t([0-9]+)\.html/", $filename, $match)) {
      $userinfo[threadid] = $match[1];
      $userinfo[activity] = 'showthread';
      $threadids .= ",$userinfo[threadid]";
    } elseif (preg_match ("/f([0-9]+)/", $filename, $match)) {
      $forumid = $match[1];
      $forumids .= ",$forumid";
      $userinfo[activity] = 'forumdisplay';
      $userinfo[forumid] = $forumid;
    } elseif (preg_match ("/robots\.txt/", $filename)) {
      $userinfo[activity] = 'spider';
    } else {
      $userinfo[activity] = 'unknown';
    }
  }


nuno 10-06-2002 11:30 PM

Tada, working like a charm now :bunny:
Muchas gracias Paul :)

Velocd 10-12-2002 03:21 PM

I've attempted an installation of this hack, but am facing an annoying obstacle.

Where in the world is this httpd.conf file located? I have found .htaccess in my forums directory, which is a completely blank file, but not httpd.conf. Which am I suppose to modify?

Velocd 10-13-2002 01:15 AM

*gasp*

on..verge..of..death..need.......help ;)

fastforward 10-13-2002 02:36 AM

Quote:

Originally posted by Velocd
I've attempted an installation of this hack, but am facing an annoying obstacle.

Where in the world is this httpd.conf file located? I have found .htaccess in my forums directory, which is a completely blank file, but not httpd.conf. Which am I suppose to modify?

The location of httpd.conf is dependent on your installation of Apache. Probably the most common place for it is /etc/

If you are unfamiliar with editing this file... be careful; your web server depends on it.

filburt1 10-14-2002 03:59 PM

FYI, on OS X, it's in /etc/httpd/ :)

filburt1 10-14-2002 05:20 PM

Okay, my .htaccess file must be at fault. My site is at /home/filburt1/public_html/webdesignforums/ ; it's an addon domain in CPanel. So http://www.webdesignforums.net/ really loads http://webdesignforums.turtletips.com/ , same as http://www.turtletips.com/webdesignforums/ .

I get 404 errors for every single link. My .htaccess is identical to eva's.

Velocd 10-15-2002 03:28 AM

Quote:

Originally posted by fastforward

The location of httpd.conf is dependent on your installation of Apache. Probably the most common place for it is /etc/

If you are unfamiliar with editing this file... be careful; your web server depends on it.

Well crap, I can't seem to find it anywhere :sleep:
Not that I'm bitter about it :p

Velocd 10-16-2002 12:29 AM

*one day later*

Ok so maybe I'm "alittle" bitter about it... ;)

I searched for the file httpd.conf and couldn't find it anywhere. :(

It looks like according to this thread there is another way to install this hack using .htaccess? Maybe..?

Velocd 10-17-2002 04:59 AM

*one day later*

So, I walked into this bar, and this guy asked me "Watcha looking for", and I said "httpd.conf, you know where it is?" And then he said...

oh wait..uh..that was random *confused*

Anyway, could somebody please help this poor guy out in his search for the holy httpd.conf..or other methods to installing this hack (see above thread)

fastforward 10-17-2002 09:31 PM

Are you on a dedicated server? If not, you may not have access httpd.conf. If you are on a dedicated, what is the OS and what is the web server or who is your host?

I believe somebody installed this using .htaccess although I have not done so.

Velocd 10-18-2002 04:46 AM

I'm not on a dedicated server..so that is probably the reason I cannot find the file. :(

[high]* Velocd snaps his fingers then walks away[/high]

jOOPeON 10-21-2002 06:12 AM

Hi guys,

I installed this great hack couple weeks ago and everything went like charm.
Thread links looks just like they should look ( domain.com/t27927.html),
forums looks ok (domain.com/f232)....

I've been watching Google to visit all the forums, but for some reason it doesn't touch the threads?
Have they changed the bot or what could be wrong?
Anyway the googlebots visits the site daily and every day it spiders everything else but threads??

-jOOP

jOOPeON 10-21-2002 10:30 AM

Quote:

Originally posted by jOOPeON
Hi guys,

I installed this great hack couple weeks ago and everything went like charm.
Thread links looks just like they should look ( domain.com/t27927.html),
forums looks ok (domain.com/f232)....

I've been watching Google to visit all the forums, but for some reason bots doesn't touch the threads?
Have they changed the bot or what could be wrong?
Anyway the googlebots visits the site daily and every day they spiders everything else but threads??

-jOOP

Now i changed also the forum links to look like www.domain.com/f1231.html

Will see what happens?

-jOOP

Paul 11-02-2002 03:46 AM

[QUOTE]Originally posted by eva2000
got it to work now with this
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]


Paul 11-02-2002 05:08 AM

[QUOTE]Originally posted by fastforward

easypeasy :)
In online.php : Change the 'default' block of the CASE statement on or around line 626 to look like this:
Code:

  default:
    if (preg_match ("/t([0-9]+)\.html/", $filename, $match)) {
      $userinfo[threadid] = $match[1];
      $userinfo[activity] = 'showthread';
      $threadids .= ",$userinfo[threadid]";
    } elseif (preg_match ("/f([0-9]+)/", $filename, $match)) {
      $forumid = $match[1];
      $forumids .= ",$forumid";
      $userinfo[activity] = 'forumdisplay';
      $userinfo[forumid] = $forumid;
    } elseif (preg_match ("/robots\.txt/", $filename)) {
      $userinfo[activity] = 'spider';
    } else {
      $userinfo[activity] = 'unknown';
    }
  }


Paul 11-03-2002 10:42 PM

Now--this should be interesting. I'm having quite a serious issue with my forum, and I'm guessing it has something to do with this hack. Prior to installing it, we hadn't seen it before.

I'm using the following rewrite rules:

Code:

        RewriteEngine on
        RewriteRule ^/forumdisplay.php(.*)$ /forums/forumdisplay.php$1 [R=permanent,L]
        RewriteRule ^/f([0-9]+)/?$ /forums/forumdisplay.php?forumid=$1 [L]
        RewriteRule ^/f([0-9]+)/s([^/]+?)\.html$ /forums/forumdisplay.php?forumid=$1&s=$2 [L]
        RewriteRule ^/f([0-9]+)/t([0-9]+)/?$ /forums/showthread.php?threadid=$2 [L]
        RewriteRule ^/f([0-9]+)/t([0-9]+)/s([^/]+?)\.html$ /forums/showthread.php?threadid=$2&s=$3 [L]
        RewriteRule ^/t([0-9]+)\.html$ /forums/showthread.php?threadid=$1 [L]
        RewriteRule ^/t([0-9]+)/s([^/]+?)\.html$ /forums/showthread.php?threadid=$1&s=$2 [L]
        RewriteRule ^/s([^/]+?)\.html$ /forums/index.php?s=$1 [L]

        RewriteRule ^/forums/f([0-9]+)/?$ /forums/forumdisplay.php?forumid=$1 [L]
        RewriteRule ^/forums/f([0-9]+)/s([^/]+?)\.html$ /forums/forumdisplay.php?forumid=$1&s=$2 [L]
        RewriteRule ^/forums/f([0-9]+)/t([0-9]+)/?$ /forums/showthread.php?threadid=$2 [L]
        RewriteRule ^/forums/f([0-9]+)/t([0-9]+)/s([^/]+?)\.html$ /forums/showthread.php?threadid=$2&s=$3 [L]
        RewriteRule ^/forums/t([0-9]+)\.html$ /forums/showthread.php?threadid=$1 [L]
        RewriteRule ^/forums/t([0-9]+)/s([^/]+?)\.html$ /forums/showthread.php?threadid=$1&s=$2 [L]
        RewriteRule ^/forums/s([^/]+?)\.html$ /forums/index.php?s=$1 [L]

I did it this way so that www.domain.com/f1 links would work as well as www.domain.com/forums/f1--so far so good. The problem is that every time I follow a link, a new session hash is generated--this means all sorts of login problems.

Could this be related to this hack in some way? I don't even know where to start! :(

Thanks,
Paul

Edit: I also made an adjustment to online.php. My version looks like this:

PHP Code:

  // Hack: Allow WOL to work with spider friendly URLs - Nov 2, 2002 - Paul
  /*
    $userinfo[activity] = 'unknown';
  */
    
if (preg_match ("/t([0-9]+)/"$loc$match)) {
       
$userinfo[threadid] = $match[1];
       
$userinfo[activity] = 'showthread';
       
$threadids .= ",$userinfo[threadid]";
    } elseif (
preg_match ("/f([0-9]+)/"$loc$match)) {
       
$forumid $match[1];
       
$forumids .= ",$forumid";
       
$userinfo[activity] = 'forumdisplay';
       
$userinfo[forumid] = $forumid;
    } elseif (
preg_match ("/robots\.txt/"$filename)) {
       
$userinfo[activity] = 'spider';
    } else {
      
$userinfo[activity] = 'unknown';
    }
  
// End hack: Allow WOL to work with spider friendly URLs 


Erwin 11-03-2002 10:50 PM

Change &s=$2 to just &s= in your .htaccess and see what happens. It works for me. However, this way, sessionhash is always cleared. I have had no problems with any of my users - I just tell them they need to enable cookies for my site to work.

Paul 11-03-2002 10:55 PM

Hi Erwin,

Thanks for the suggestion. The *REALLY* weird part about this is that I'm using the vbulletin URL's to test this out--it DOESN'T happen when I use the rewrite urls. (i.e. http://www.domain.com/forums/index.php?s=######...)

I don't want to force them to use cookies though :(... I'm staring at the apache rewrite rule manual now trying to figure out what I'm missing here. :)

Paul 11-03-2002 11:10 PM

I removed the redirects completely, restarted apache, and uploaded the unhacked online.php--the problems continued to persist. I wonder if this might be a real vb bug ;)

Erwin 11-04-2002 12:09 AM

Works fine for me. Are you surfing through AOL? The latest AOL browser has some session problems with vB. Make sure you are using vB 2.2.8

Paul 11-04-2002 12:15 AM

Hi Erwin,

I narrowed down this problem to the sessions.php PPN posted in the sticky over on vbulletin.com's troubleshooting forum. Sorry, I forgot all about posting in this thread ;) I was just too happy to realize I didn't break it :D

Thanks again,
Paul

Paul 11-05-2002 01:23 PM

The addition of the following code to postings.php will allow you to use the search-engine friendly URLs to merge threads:

Below:
PHP Code:

  // get other threadid
  
$getthreadid=intval(substr($mergethreadurl,strpos($mergethreadurl,"threadid=")+9)); 

Insert:
PHP Code:

  // Hack: Work with search-engine friendly links
  
$getsearchfriendlythreadid=intval(substr($mergethreadurl,strpos($mergethreadurl,"/t")+2));
  if (
$getthreadid==0) {
    
$getthreadid=$getsearchfriendlythreadid;
  }
  
// End hack: Work with search-engine friendly links 

This will only work if your new url's contain "/t<threadnumber>". If you are using a different prefix, you'll need to alter the script accordingly, where the "2" equals the number of characters within the quotes. Also, if your forum resides in a directory that starts with the letter "t" this will not work for you. You'll need to modify it. :)

Erwin 11-05-2002 05:27 PM

I already modified my postings.php to do the same too, but I made it so that mods can just use the threadid number. :)

dwh 11-08-2002 08:34 AM

I could not get this to work no matter which way I tried...the rewrite doesn't work even though supposedly I have it installed....

Also, I am using /forums/

The Piper 11-08-2002 06:51 PM

I am having trouble with forumjump after installing this hack. Even if I have forumjump turned on on my control panel, it doesn't work. So I can't merge or move threads, for instance. Any thoughts on this issue?

Thomas P 11-13-2002 03:38 AM

Okay, my hoster finally told me, that I need a RewriteCondition statement on his servers (?) in order for rewrites to work.

Is there a standard RewriteCond I can use or do we poor .htaccess users ;) need a special one for this hack?

Dontom 11-16-2002 08:51 PM

I installed this great hack - the day after a part of my forums & threads already were present in google:)
tom

AWS 12-02-2002 07:15 PM

Just to show this hack actually works and works well

fello9 12-05-2002 09:47 PM

Quote:

Originally posted by The Piper
I am having trouble with forumjump after installing this hack. Even if I have forumjump turned on on my control panel, it doesn't work. So I can't merge or move threads, for instance. Any thoughts on this issue?
Any answer on how to fix this problem?


All times are GMT. The time now is 08:58 AM.

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.01483 seconds
  • Memory Usage 1,866KB
  • 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
  • (15)bbcode_code_printable
  • (3)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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