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)

eva2000 05-28-2001 08:53 AM

woah i had to edit nearly all of my templates :eek:

first important one

do a search template for the forum action part
Quote:

<form action="
and you'll have to change them all to
Quote:

<form action="/
otherwise, posting, replying, logging in and out and any forms won't work in netscape :(

only images i couldn't find the link to edit to add $bburl/ to are
Quote:

$post[foldericon]
and the only link i can't seem to find to add $bburl/ to is in forumdisplaybit

Quote:

$thread[postedby]
where is this ?

fastforward 05-28-2001 03:48 PM

I also had a problem with the bbcode smilies not showing up. I had to edit functions.php and add a slah before the href in this line:
Code:

$bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"/$smilie[smiliepath]\" border=\"0\" alt=\"\">",$bbcode);
It's on or around line 362.

Not sure about the posted by link yet.

I wish I'd never thought of this hack now :(

eva2000 05-29-2001 12:52 PM

i fixed the smilies and posticon problem by adding a slash / in the edit smilies in the admin panel

also another problem

merging threads won't work with your shorter url :(

is it possible to show/display the real url in a small table on/under the thread or on the merge thread template

i.e. display something like please input the thread to merge in the format

http://animeboards.com/showthread.php?s=&threadid=XXXX

where XXXX corresponds to

http://animeboards.com/tXXXX/s.html

fastforward 05-29-2001 03:44 PM

Quote:

Originally posted by eva2000
i fixed the smilies and posticon problem by adding a slash / in the edit smilies in the admin panel

also another problem

merging threads won't work with your shorter url :(

is it possible to show/display the real url in a small table on/under the thread or on the merge thread template

i.e. display something like please input the thread to merge in the format

http://animeboards.com/showthread.php?s=&threadid=XXXX

where XXXX corresponds to

http://animeboards.com/tXXXX/s.html

What we need is a little link that can be displayed on every page that whne clicked, will reload whatever page you happen to on using the original url. It should be possible with a seperate php script. However, I gotta wonder if it's really worth the hassle. I might just give it up and just use Overgrow's hack.

There must be an easier way than this. I'm going to spend a few hours reading the Apache docs. I can't believe it needs to be this hard.

eva2000 05-29-2001 03:49 PM

Quote:

Originally posted by fastforward

What we need is a little link that can be displayed on every page that whne clicked, will reload whatever page you happen to on using the original url. It should be possible with a seperate php script. However, I gotta wonder if it's really worth the hassle. I might just give it up and just use Overgrow's hack.

There must be an easier way than this. I'm going to spend a few hours reading the Apache docs. I can't believe it needs to be this hard.

well for what it's worth.. google.com bot paid my forums and visit and i can see it running all the way through my forums especially with overgrow's hack but yours as well :D

Porfiry 07-16-2001 04:52 AM

I see that I'm digging up an old thread, but I have a solution to the problem discussed.

The answer is rewriting!

Code:

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

RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]

I've modified the first 2 rules a bit to make things easier. The 3rd rule simply changes any URL like "/f1/s1/newreply.php" that would normally cause a problem and just rewrites it to "/newreply.php". This should also work for any images. No need to muck with templates.

eva2000 07-16-2001 09:38 AM

Quote:

Originally posted by porfiry
I see that I'm digging up an old thread, but I have a solution to the problem discussed.

The answer is rewriting!

Code:

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

RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]

I've modified the first 2 rules a bit to make things easier. The 3rd rule simply changes any URL like "/f1/s1/newreply.php" that sould normally cause a problem and just rewrites it to "/newreply.php". This should also work for any images. No need to muck with templates.

where were you when i added this hack :)

what i did for my subsequent styles was create replacement variables for form and other urls and it works but i'll try your method when an upgrade to the next release might force me to revert too many templates :D

VirtueTech 07-17-2001 03:55 PM

Eva check your PM's please

fastforward 07-18-2001 03:50 PM

Like eva2000, I also solved it the hard way :(

Although the form problems were happening in both IE and Netscape, Netscape also had a lot of other problems with normal links. Does this method work with Netscape?

I'll try it when 2.02 is released :)

steven 07-24-2001 05:42 PM

Quote:

Originally posted by porfiry
I see that I'm digging up an old thread, but I have a solution to the problem discussed.

The answer is rewriting!

Code:

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

RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]

I've modified the first 2 rules a bit to make things easier. The 3rd rule simply changes any URL like "/f1/s1/newreply.php" that sould normally cause a problem and just rewrites it to "/newreply.php". This should also work for any images. No need to muck with templates.

Sorry to bring up an old thread again, but I would like to use this hack on my board and had a couple of questions. I was wondering how I would change the above code to reflect my forums directory which is not run as root, but is run as http://www.mydomain.com/forums

Any Help is greatly appreciated.
Steven

ThomasP 07-29-2001 12:03 PM

Quote:

Originally posted by steven
I was wondering how I would change the above code to reflect my forums directory which is not run as root, but is run as http://www.mydomain.com/forums

Any Help is greatly appreciated.
Steven

http://www.vbulletin.com/forum/showt...210#post114210

ThomasP 07-29-2001 12:51 PM

Fantastic hack! But I have some problems:

Okay, a.m. fastforward's hint works for me,
but I have problems with rewriting in general as it seems.

This is my .htaccess on Apache 1.3.20 placed in the root dir.

Code:

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

# Testing
RewriteRule ^forum/foo/(.*)$ /bar/index.html [R]

Test:

http://mcseboard.de/forum/foo/

is rewritten to

http://mcseboard.de/bar/index.html


So, rewrites seem to work - just try the link.
But my board behaves as usual making no notice of the rules as it seems.
What's going wrong here?

Thanks for any hint,
-Tom

P.S.: I don't have access to httpd.conf or the RewriteLog if there is...

auto 07-29-2001 01:07 PM

This is what i have in my .htaccess in the root directory:

Quote:

RewriteEngine on
RewriteRule ^vbulletin/f([0-9]+)/s([^/]*)/$ /forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^vbulletin/t([0-9]+)/s([^/]*)/thread\.html$ /showthread.php?threadid=$1&s=$2 [L]
RewriteRule ^vbulletin/[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]
and the rule does not appear to work :(

My vB is here: http://www.automotiveforums.com/vbulletin/index.php

any help would be appreciated.

ThomasP 07-29-2001 01:18 PM

Hi,

does rewriting work in general?

Try to test it with something like
RewriteRule ^vbulletin/foo/(.*)$ /bar/index.html [R]

Enter http://yourdomain/vbulletin/foo/

Rewriting works for me in general, but the board doesn't seem
to be affected...
-Tom

auto 07-29-2001 06:12 PM

RewriteRule ^vbulletin/foo/(.*)$ /index.php [R]

that works,
when you go to http://www.automotiveforums.com/vbulletin/foo/
it directs you to the index page.

ThomasP 07-29-2001 08:03 PM

Then we seem to have the same problem... :(

auto 07-29-2001 09:52 PM

Sure does look like it.

fastforward 07-29-2001 10:06 PM

This may or may not help. It will probably confuse things even more :)

Here's what I have in my httpd.conf:
Code:

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

I dispensed with the session tag as it wasn't really helping the spiders becaue the number would change each time anyway. I also edited all my templates to sort out the drop-down problems (I did this before I read porfiry's post).

In your problem examples I notice you don't start the url with a slash. You might want to try that. You never know.

ThomasP 07-30-2001 08:19 PM

Hi fastforward,

thanks for answering, I tried that, but it didn't seem to work :(

Are these the only two line regarding rewrite in your conf?
Where is the one which builds the /f1/... or /fx/...? :)

I really would like to sort it out since this is one of the most useful hack for vB ever - maybe even for php-based sites in general.

Thanks,
-Tom

eva2000 07-30-2001 09:02 PM

Quote:

Originally posted by fastforward
This may or may not help. It will probably confuse things even more :)

Here's what I have in my httpd.conf:
Code:

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

I dispensed with the session tag as it wasn't really helping the spiders becaue the number would change each time anyway. I also edited all my templates to sort out the drop-down problems (I did this before I read porfiry's post).

In your problem examples I notice you don't start the url with a slash. You might want to try that. You never know.

what do i need to do to remove the session tag but still have this format

http://animeboards.com/f38/s
http://animeboards.com/t20418/s.html

?

currently i have in my httpd.conf
Quote:

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]
RewriteRule ^/html/.* /html/index.php [L]
thanks :)

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

GameCrash 09-20-2001 02:47 PM

Quote:

Originally posted by TheComputerGuy
where can I find the htaccess
Don't forget the dot... it must be called .htaccess :)

Thomas P 09-21-2001 07:40 AM

Hi GameCrash!

have you tried that hack on d)f?
Btw: I'm with d)f now, too. Great support and nice features.
cu,
-Tom

GameCrash 09-21-2001 07:47 AM

Sorry, D)F does not support mod_rewrite. So if you try to turn the RewriteEngine to on you will get an error 500, sorry ;)

Thomas P 09-21-2001 10:55 AM

Quote:

Originally posted by GameCrash
Sorry, D)F does not support mod_rewrite. So if you try to turn the RewriteEngine to on you will get an error 500, sorry ;)
I have the answer from d)f support that mod_rewrite is enabled.
The following works for example:

Code:

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

create a directory named "test" and put the above into an .htaccess into the dir. test to try that - it works!
But not all from fastforwards samples, so that's why I wonder... :confused:
-Tom

GameCrash 09-21-2001 11:34 AM

Well... maybe they have enabled it now as so many people have asked for it - the last time I asked they said it's disabled...

Thomas P 09-21-2001 12:44 PM

I see, yeah could be...
Still couldn't get it working properly.
Do you have any plans to try that?
I'll play around the next days with it.
cu,
-Tom

GameCrash 09-21-2001 12:57 PM

No, I won't as I will change my hoster the next days (I hope). I will go to a gamesite hoster - it's cheaper for me ;)

Thomas P 09-21-2001 02:15 PM

May I ask which one?

GameCrash 09-21-2001 02:22 PM

No :D

And I don't think we should discuss this in this thread any more ;)

steven 09-28-2001 06:08 PM

So does anyone have a final version of this hack, as I would really like to use it on my site via an .htaccess file.


All times are GMT. The time now is 11:28 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.01559 seconds
  • Memory Usage 1,851KB
  • 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
  • (10)bbcode_code_printable
  • (16)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