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)

fastforward 07-30-2001 09:37 PM

Gimme till tomorrow night and I'll redo the hack based on the 2.02 code and post full instructions. I'll use the 'double rewrite' method that porfiry contributed to avoid changing a bazillion templates :)

ThomasP: The /f12 bits are created by editing the templates. All the rewrite does is change those short urls back to something that the vB php code knows about.

ThomasP 07-30-2001 09:55 PM

oops, my bad - I see.
Thanks for your help and take your time,
-Tom

auto 07-31-2001 12:20 AM

I finally got it to work by taking out the extra "/" from the first 2 lines, wooohooo!!!:D
Now I face smaller, yet another problem.

Take this page for example:
http://www.automotiveforums.com/vbulletin/t4667.html
The 2nd page of the thread will not be indexed by search engines :(

How can I use mod_rewrite to make the 2nd page be
http://www.automotiveforums.com/vbulletin/t4667-2.html
3rd page: http://www.automotiveforums.com/vbulletin/t4667-3.html... etc?

Thanks for any help.

auto 07-31-2001 02:58 PM

Well, I've done it!:D

http://www.automotiveforums.com/vbulletin/t4667.html

And click on page 2, 3, and 4 ;)

Thread [ << < 1 2 3 4 > >> ]

If there's anybody that wants the rewrite code for this I'll post it, it was easier than I thought, after twisting my head for 2 hours.

fastforward 07-31-2001 04:44 PM

Quote:

Originally posted by auto
Well, I've done it!:D

http://www.automotiveforums.com/vbulletin/t4667.html

And click on page 2, 3, and 4 ;)

Thread [ << < 1 2 3 4 > >> ]

If there's anybody that wants the rewrite code for this I'll post it, it was easier than I thought, after twisting my head for 2 hours.

You didn't tell us you were doing it! I spent hours last night doing this :D Actually, 2.0.2 made it a little easier due to the change in the pagenav handling.

Mine appears to be working on IE, but I haven't tried every possible scenario and I haven't tested it on Netscape. It handles multipage threads, but I still need to add support for multi-page threadlistings. Once complete, you should be able to block spiders from all dynamic urls and still have them index ALL posts.

If anyone wants to help debug it, here it is:

----------------------------------------------

1) Edit /etc/httpd.conf
httpd.conf needs editing to enable and configure mod_rewrite. Here's all the relevent bits from my httpd.conf. It can go anywhere between the <VirtualHost> & </VirtualHost> tags.
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]




2) Edit Templates
a. The following templates contain the forum links that need changing (one occurance in each)

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

The new link should be: <a href="$bburl/f$forum[forumid]/">$forum[title]</a>


b. The following template contains the thread link that needs changing:

-> forumdisplaybit

The new link should be: <a href="$bburl/t$thread[threadid].html">$thread[title]</a>


c. The following templates contain the pagenav bits:

-> forumdisplay_multipagenav_pagenumber

Replace the link within this templatewith:
$bburl/t$thread[threadid]-$acurpage.html

--------------------------------------------------------------

auto 07-31-2001 07:55 PM

This is what I added for the thread#-page#.html to work:

RewriteRule ^t([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=10&pagenumber=$ 2 [L]

Then I had to modify functions.php

You can find what to modify by finding the veriables that correspond to the page nav in the templates.

Thomas P 09-09-2001 03:07 PM

Has anyone managed to get that working via .htaccess?
If mod_rewrite is enabled it works as well via .htaccess - right?

At least that works on my account:
Code:

RewriteEngine on
RewriteBase /test/
RewriteRule  ^(.+)  http://www.mcseboard.de/$1  [R,L]

thx,
-Tom

steven 09-11-2001 06:33 AM

Quote:

Originally posted by Thomas P
Has anyone managed to get that working via .htaccess?
If mod_rewrite is enabled it works as well via .htaccess - right?

At least that works on my account:
Code:

RewriteEngine on
RewriteBase /test/
RewriteRule  ^(.+)  http://www.mcseboard.de/$1  [R,L]

thx,
-Tom

I would also like to know if anyone has managed to do this via .htaccess?

TheComputerGuy 09-20-2001 12:38 AM

where can I find the htaccess that you speak of, I mean I looked all over my account and could not find it...

Thomas P 09-20-2001 07:13 AM

Just create one...


All times are GMT. The time now is 12:51 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.01445 seconds
  • Memory Usage 1,746KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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