View Full Version : Spider friendly URLs
fastforward
05-24-2001, 10:00 PM
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 (http://www.vbulletin.com/forum/showthread.php?s=&threadid=15628).
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 :D
eva2000
05-25-2001, 05:45 AM
got a demo/example url for us ?
fastforward
05-25-2001, 12:36 PM
Originally posted by eva2000
got a demo/example url for us ?
http://dbforums.com
You can see the forum links on the front page are like :
http://dbforums.com/f5/s
and the threads are like:
http://dbforums.com/t44153/s.html
Overgrow
05-25-2001, 03:17 PM
Hey very cool.. I haven't looked at the code yet, but nice job.
One note though: The main point of my hack is getting Google to the archives, not really friendly URLs.. that was just a sidenote. The archiving is what I'm after.
eva2000
05-25-2001, 11:06 PM
yeah cool but do normal showthreads and forumdisplay urls still work ?
i.e would a url like http://animeboards.com/forumdisplay.php?s=&forumid=2 still work as well as
http://animeboards.com/f2/s ?
fastforward
05-25-2001, 11:27 PM
Originally posted by eva2000
yeah cool but do normal showthreads and forumdisplay urls still work ?
i.e would a url like http://animeboards.com/forumdisplay.php?s=&forumid=2 still work as well as
http://animeboards.com/f2/s ?
hehe. Oh ye of little faith
Yeah they do. :)
The only urls that are trapped by the mod_rewrite directives are ones that match one of these three expressions:
^/f([0-9]+)/s([^/]+?)$
^/t([0-9]+)/s([^/]+?)\.html$
^/s([^/])+?/$
ie.
/f234/s or /f234/s345345detr3
/t2343/s.html or /t2343/s435345.html
/s/ or /s435345345dfsdf/
Actually I need to clarify in the docs that this assumes your forums are in the web root. Those directives should be prefixed with /forums/ or wherever if your vB is installed elsewhere.
eva2000
05-25-2001, 11:28 PM
cool.. yet another hack i'm gonna add hehe
eva2000
05-25-2001, 11:30 PM
oh wait any problems you can see running both overgrow's search engine spidering hack and yours together ? i also use htacess to use mod_rewrite to prevent hot linking of my forum images
fastforward
05-26-2001, 01:04 AM
Originally posted by eva2000
oh wait any problems you can see running both overgrow's search engine spidering hack and yours together ? i also use htacess to use mod_rewrite to prevent hot linking of my forum images
No problems at all. I just installed Overgrows :)
http://dbforums.com/archive/
I did make one change to Overgrows though so that I wouldn't need to use .htaccess files. I deleted the .htaccess and added this to my httpd.conf:
RewriteRule ^/archive/.* /archive/index.php [L]
But either method will work.
eva2000
05-26-2001, 01:42 AM
Originally posted by fastforward
No problems at all. I just installed Overgrows :)
http://dbforums.com/archive/
I did make one change to Overgrows though so that I wouldn't need to use .htaccess files. I deleted the .htaccess and added this to my httpd.conf:
RewriteRule ^/archive/.* /archive/index.php [L]
But either method will work. okay great then :)
eva2000
05-26-2001, 01:52 AM
okay i already have mod_rewrite so what do i do for the first step something like this ?
<VirtualHost 157.238.46.185>
ServerAdmin webmaster@animeboards.net
DocumentRoot /home/usr1/public_html
BytesLog domlogs/animeboards.net-bytes_log
ServerName www.animeboards.net
ServerAlias animeboards.com *.animeboards.com
CustomLog domlogs/animeboards.net combined
ScriptAlias /cgi-bin/ /home/usr1/public_html/cgi-bin/
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]
</VirtualHost>
fastforward
05-26-2001, 01:59 AM
That's correct as long as your foums are in the web root. If not, you need to change those to something like:
RewriteRule ^/forums/t([0-9]+)/s([^/]+?)\.html$ /showthread.php?threadid=$1&s=$2 [L]
eva2000
05-26-2001, 02:02 AM
okay gonna implement this now hehe
eva2000
05-26-2001, 02:38 AM
okay installed one problem i sthe showthread links for
Go to first unread post go to
http://animeboards.com/# now
also
Admin options for
split
merge
move
stick/unstick threads all don't work
as well as view mod queue, view attachment queue etc
they are redirect to my front page since i have an htaccess for error redirects to my front page
fastforward
05-26-2001, 02:51 AM
Originally posted by eva2000
okay installed one problem i sthe showthread links for
Go to first unread post go to
http://animeboards.com/# now
Not sure what you mean here.
also
Admin options for
split
merge
move
stick/unstick threads all don't work
as well as view mod queue, view attachment queue etc
they are redirect to my front page since i have an htaccess for error redirects to my front page
I really can't see how the changes could in anyway affect these. You did only change the links in the forumhome and forumdisplay templates right?
The links you're talking about don't even point to pages that use these templates. they are still in their original form and point to postings.php.
eva2000
05-26-2001, 02:57 AM
Originally posted by fastforward
Not sure what you mean here.
I really can't see how the changes could in anyway affect these. You did only change the links in the forumhome and forumdisplay templates right?
The links you're talking about don't even point to pages that use these templates. they are still in their original form and point to postings.php. well i'm using the drop downmenu version of the admin options
for the other problem i.e.
this thread the link to
http://vbulletin.com/forum/showthread.php?s=&postid=114233#newpost
goes to
http://vbulletin.com/forum/# on my forum
fastforward
05-26-2001, 03:07 AM
Show me the Rewrite directives you put in your httpd.conf.
And what's this admin drop down options thingy you're talking about?
And the only templates changed were the ones in the instructions. One occurance in each template?
eva2000
05-26-2001, 03:09 AM
okay i fixed the goto new or unread thread link by editing the showthread_firstunread template
<a href="showthread.php?s=$session[sessionhash]&threadid=$threadid$newpostlink">Go to first unread post</a> <a href="showthread.php?s=$session[sessionhash]&threadid=$threadid$newpostlink"><img src="{imagesfolder}/firstnew.gif" border="0" alt="first unread" align="absmiddle"></a>
but it seems the admin options drop down menu takes the relavtive url of the thread
so if it's
http://animeboards.com/showthread.php?s=&threadid=18752
it will work but
http://animeboards.com/t18752/s.html will
look for
http://animeboards.com/t18752/s.html/postings.php or something
eva2000
05-26-2001, 03:12 AM
these
eva2000
05-26-2001, 03:12 AM
and this
fastforward
05-26-2001, 03:12 AM
Did you put the baseurl tag in the header template. That should stop those errors. You may need to alter it slightly to reflect your forum directory.
What is this drop down admin menu? Is it with the new templates? I still need to revert some of mine from RC3.
eva2000
05-26-2001, 03:13 AM
Originally posted by fastforward
Did you put the baseurl tag in the header template. That should stop those errors. You may need to alter it slightly to reflect your forum directory.
What is this drop down admin menu? Is it with the new templates? I still need to revert some of mine from RC3. yes base url is in head insert already
i think if you revert your templates you'll know what i'm talking about
eva2000
05-26-2001, 03:20 AM
template showthread_adminoptions contains
<table cellpadding="0" cellspacing="0" border="0">
<form action="postings.php" method="get"><tr><td>
<smallfont>
<input type="hidden" name="s" value="$session[dbsessionhash]">
<input type="hidden" name="threadid" value="$threadid">
<b>Admin Options:</b><br>
<select name="action" onchange="window.location=('postings.php?s=$session[dbsessionhash]&action='+this.options[this.selectedIndex].value+'&threadid=$threadid')">
<option value="editthread" selected>-- Thread Options --</option>
<option value="openclosethread">Open / Close Thread</option>
<option value="move">Move / Copy Thread</option>
<option value="editthread">Edit Thread</option>
<option value="deletethread">Delete Thread / Posts</option>
<option value="merge">Merge Threads</option>
<option value="split">Split Thread</option>
<option value="stick">Stick / Unstick Thread</option>
</select>
<input type="image" src="images2/go.gif" border="0" align="absbottom">
</smallfont>
</td></tr></form>
</table>
and forumdisplay_adminoptions
<table cellpadding="0" cellspacing="0" border="0">
<form action="moderator.php" method="get"><tr><td>
<smallfont>
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="forumid" value="$forumid">
<b>Admin Options:</b><br>
<select name="action" onchange="window.location=('moderator.php?s=$session[sessionhash]&forumid=$forumid&action='+this.options[this.selectedIndex].value)">
<option value="modposts" selected>-- Forum Options --</option>
<option value="modposts">View Posts Queue</option>
<option value="modattach">View Attachment Queue</option>
<option value="move">Mass Move</option>
<option value="prune">Mass Prune</option>
</select>
<input type="image" src="images2/go.gif" border="0" align="absbottom">
</smallfont>
</td></tr></form>
</table>
fastforward
05-26-2001, 03:20 AM
hmmm. Not sure about that then. Sorry. Maybe I'd better not revert my templates. My text admin options work :D
What about the forum jump? If that fails on yours then the problem can be fixed within the templates. That dropdown works on mine.
fastforward
05-26-2001, 03:21 AM
Just prefix the postings.php reference in those templates with the $ bburl variable. ie $ bburl/postings.php..etc
eva2000
05-26-2001, 03:24 AM
Originally posted by fastforward
hmmm. Not sure about that then. Sorry. Maybe I'd better not revert my templates. My text admin options work :D
What about the forum jump? If that fails on yours then the problem can be fixed within the templates. That dropdown works on mine. forum jump does NOT work when used on http://animeboards.com/f1/s but works on the real url
eva2000
05-26-2001, 03:30 AM
Originally posted by fastforward
Just prefix the postings.php reference in those templates with the $ bburl variable. ie $ bburl/postings.php..etc yay that worked now for the other people trying this
template showthread_adminoptions
<table cellpadding="0" cellspacing="0" border="0">
<form action="postings.php" method="get"><tr><td>
<smallfont>
<input type="hidden" name="s" value="$session[dbsessionhash]">
<input type="hidden" name="threadid" value="$threadid">
<b>Admin Options:</b><br>
<select name="action" onchange="window.location=('$bburl/postings.php?s=$session[dbsessionhash]&action='+this.options[this.selectedIndex].value+'&threadid=$threadid')">
<option value="editthread" selected>-- Thread Options --</option>
<option value="openclosethread">Open / Close Thread</option>
<option value="move">Move / Copy Thread</option>
<option value="editthread">Edit Thread</option>
<option value="deletethread">Delete Thread / Posts</option>
<option value="merge">Merge Threads</option>
<option value="split">Split Thread</option>
<option value="stick">Stick / Unstick Thread</option>
</select>
<input type="image" src="images2/go.gif" border="0" align="absbottom">
</smallfont>
</td></tr></form>
</table>
and forumdisplay_adminoptions
<table cellpadding="0" cellspacing="0" border="0">
<form action="moderator.php" method="get"><tr><td>
<smallfont>
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="forumid" value="$forumid">
<b>Admin Options:</b><br>
<select name="action" onchange="window.location=('$bburl/moderator.php?s=$session[sessionhash]&forumid=$forumid&action='+this.options[this.selectedIndex].value)">
<option value="modposts" selected>-- Forum Options --</option>
<option value="modposts">View Posts Queue</option>
<option value="modattach">View Attachment Queue</option>
<option value="move">Mass Move</option>
<option value="prune">Mass Prune</option>
</select>
<input type="image" src="images2/go.gif" border="0" align="absbottom">
</smallfont>
</td></tr></form>
</table>
forumjump template
<table cellpadding="0" cellspacing="0" border="0">
<form action="forumdisplay.php" method="get"><tr><td>
<smallfont>
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="daysprune" value="$daysprune">
<b>Forum Jump:</b><br>
<select name="forumid" onchange="window.location=('$bburl/forumdisplay.php?s=$session[sessionhash]&forumid='+this.options[this.selectedIndex].value+'&daysprune=$daysprune')">
<option value="-1" $defaultselected>Please select one:</option>
<option value="-1">--------------------</option>
<option value="pm" $frmjmpsel[pm]>Private messages</option>
<option value="search" $frmjmpsel[search]>Search</option>
<option value="home" $frmjmpsel[home]>Home</option>
<option value="-1">--------------------</option>
$jumpforumbits
</select>
<input type="image" src="{imagesfolder}/go.gif" border="0" align="absbottom">
</smallfont>
</td></tr></form>
</table>
fastforward
05-26-2001, 03:31 AM
Originally posted by eva2000
forum jump does NOT work when used on http://animeboards.com/f1/s but works on the real url
OK, then something isn't quite right with your setup as both work on mine. It was for this reason and the broken images that the baseurl tag was put in the header. I'm not sure what else to suggest. It has to be something to do with the baseurl.
eva2000
05-26-2001, 03:32 AM
Originally posted by fastforward
OK, then something isn't quite right with your setup as both work on mine. It was for this reason and the broken images that the baseurl tag was put in the header. I'm not sure what else to suggest. It has to be something to do with the baseurl. all fixed now above previous post http://vbulletin.com/forum/showthread.php?s=&postid=114250#post114250 :)
fastforward
05-26-2001, 03:35 AM
Originally posted by eva2000
all fixed now above previous post http://vbulletin.com/forum/showthread.php?s=&postid=114250#post114250 :)
Yay... :D
Thanks mate.
I'll have to fix the docs and revert my templates tomorrow then.
eva2000
05-26-2001, 03:49 AM
Originally posted by fastforward
Yay... :D
Thanks mate.
I'll have to fix the docs and revert my templates tomorrow then. thanks... one thing though with gzip and mod_gzip enabled i'm finding the shorter urls not being compressed on access compared to the real urls although it's being reported as gzipped at http://leknor.com/code/gziped.php
fastforward
05-26-2001, 03:53 AM
Originally posted by eva2000
one thing though with gzip and mod_gzip enabled i'm finding the shorter urls not being compressed on access compared to the real urls although it's being reported as gzipped at http://leknor.com/code/gziped.php
uhh..oh! You know, I actually did wonder if that would be a problem but I checked with leknor and as you mentioned that says it is gzipped. What are you using to determine it's not?
I seem to remember that when I first implemented this it seemed slower to load. That's what prompted me to check with leknor.com. I hope I can fix this. non-gzipped pages are not acceptable :(
eva2000
05-26-2001, 03:57 AM
Originally posted by fastforward
uhh..oh! You know, I actually did wonder if that would be a problem but I checked with leknor and as you mentioned that says it is gzipped. What are you using to determine it's not?
I seem to remember that when I first implemented this it seemed slower to load. That's what prompted me to check with leknor.com. I hope I can fix this. non-gzipped pages are not acceptable :( simple browser/eye test
i loaded the shorter url page right click page properties
then loaded the real url and right click page properties and compared the 2 sizes
shorter url was 129kb and real url was 19kb
but both reported as 19kb when tested at leknor
eva2000
05-26-2001, 04:06 AM
oh yeah another thing i;m using the Zend cache trial so with html pages they won't be cached right ?
fastforward
05-26-2001, 04:08 AM
Originally posted by eva2000
simple browser/eye test
i loaded the shorter url page right click page properties
then loaded the real url and right click page properties and compared the 2 sizes
shorter url was 129kb and real url was 19kb
but both reported as 19kb when tested at leknor
I don't trust the browser method.
When I do that on threads I get 81K for the short ones and not available for on the originals. And for the forumhome I get 56K with the short url and 58K with the long url. :confused:
fastforward
05-26-2001, 04:10 AM
Originally posted by eva2000
oh yeah another thing i;m using the Zend cache trial so with html pages they won't be cached right ?
Not sure. I don't think it will have any affect. Zend shouldn't know about the rewrite. The request is translated by Apache before it gets to the PHP engine or the Zend stuff.
I'm just guessing though, I don't really know.
eva2000
05-26-2001, 05:51 AM
Originally posted by fastforward
I don't trust the browser method.
When I do that on threads I get 81K for the short ones and not available for on the originals. And for the forumhome I get 56K with the short url and 58K with the long url. :confused: okay tested it on my sister's pc and dialup connection and yup it's compressed the page shows 129kb but loads in 5 - 10 secs on 56k modem
fastforward
05-26-2001, 03:50 PM
Just to be double sure I enabled gzip logging in my Apache logs. You'll be pleased to know that it all works and everything is compressed as usual :) All the exclude and include filters work aswell, based on the original urls).
fastforward
05-27-2001, 04:15 PM
Someone alerted me to a Netscape problem when using this hack.
I seems that Netscape ignores the < BASE > tag.
Subsequently, any urls that do not start with a slash or a fully qualified domain will fail.
The solution is to go through all the showthread, forumhome and forumdisplay templates and prefix all relative HREF's with the $ bburl variable.
This means the hack isn't quite so 'quick and easy' after all :(
If someone knows why Netscape is doing this please let us know.
eva2000
05-28-2001, 05:54 AM
Originally posted by fastforward
Someone alerted me to a Netscape problem when using this hack.
I seems that Netscape ignores the < BASE > tag.
Subsequently, any urls that do not start with a slash or a fully qualified domain will fail.
The solution is to go through all the showthread, forumhome and forumdisplay templates and prefix all relative HREF's with the $ bburl variable.
This means the hack isn't quite so 'quick and easy' after all :(
If someone knows why Netscape is doing this please let us know. really ? hmmmmm
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
<form action="
and you'll have to change them all to
<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
$post[foldericon]
and the only link i can't seem to find to add $bburl/ to is in forumdisplaybit
$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:
$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
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
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!
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
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!
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
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!
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
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/showthread.php?&postid=114210#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.
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...
This is what i have in my .htaccess in the root directory:
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
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... :(
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:
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
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:
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
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
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.
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
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
--------------------------------------------------------------
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:
RewriteEngine on
RewriteBase /test/
RewriteRule ^(.+) http://www.mcseboard.de/$1 [R,L]
thx,
-Tom
steven
09-11-2001, 06:33 AM
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:
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
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
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:
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.
Haakon
10-04-2001, 10:50 AM
Hello, has anyone else got problems with downloading the hack? My Gozilla only tries to download attachments.php which is 0kb :confused:
RobAC
10-04-2001, 01:12 PM
Probably a stupid question, but where do you find the httpd.conf file? It's not listed in my directory that I can find. Is this hack something that will work on a hosted server?
Razzie
10-04-2001, 09:52 PM
If you're on a shared server then just put the commands in a .htaccess file.
RobAC
10-04-2001, 10:09 PM
Where should the .htaccess file go? Forums directory?
Razzie
10-06-2001, 10:53 AM
Yes
CoolaShacka
10-06-2001, 01:06 PM
Amazing Release. :eek:
Could pls. somebody post the endversion of it.
I've tryed a little bit arround, but is don't work for me.
Thank you in advance. :)
RobAC
10-06-2001, 03:23 PM
How does this hack handle private forums?
CoolaShacka
10-06-2001, 03:30 PM
@RobAC:
The Spiders are not registered on your Forums, ans they don't have the necessary permissons. They can not spider inside your private Forums. They can only spider in your public forums.
PS. I'm still waiting for the final release of this hack.
RobAC
10-06-2001, 03:37 PM
I don't have a full understanding of how the overall permissions would work as it relates to search engine spiders etc.
I understand that the spiders are not "registered" on the forums, but if they "spider" the threads/forums, what is to prevent them from spidering the threads in a private forum?
Haakon
10-06-2001, 04:52 PM
RobAc: The spiders visits the pages just the way we do. If we click the link to the private forum, then we will be presented with a password verification form; we don`t know it so we leave. This is the same with robots/spiders, they leave when they can`t go any further.
Razzie
10-07-2001, 12:05 AM
Also if you've set "Hide Private Forums" they won't even get the forums permission page as they won't even be able to see the forum!
Think of a web crawler as a Guest visitor.
Byron
10-20-2001, 02:45 PM
I have the following in my .htaccess
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]
Kept getting 500 errors or 404 errors.
Are there any other commands which I need to include in the .htaccess?
Thanks
Byron
10-21-2001, 07:33 AM
anyone got this hack working via .htaccess?
steven
10-21-2001, 08:09 AM
well thanks to auto, I got this working. Anyways I have my forums setup like www.mydomain.com/forums so the following is my .htaccess file
RewriteEngine on
RewriteRule ^f([0-9]+)/?$ forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^t([0-9]+)\.html$ showthread.php?threadid=$1 [L]
RewriteRule ^t([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=15&pagenumber=$2 [L]
RewriteRule ^f([0-9]+)-([0-9]+)/$ forumdisplay.php?forumid=$1&daysprune=1000&sortorder=&sortfield=lastpost&perpage=40&pagenumber=$2 [L]
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]
Byron
10-21-2001, 10:47 AM
Thanks steven.
Your .htaccess works. No more 500 or 404 errors now. But I noticed that your thread url is in the format of
http://domain.com/forums/t100.html
My thread url is in the format of
http://domain.com/forums/t100/s.html
and it leads to a 404 page as i am using fastforward's hack instructions for step 2 and 3.
May i know what did you use to replace (step 2 & 3)
<a href="$bburl/f$forum[forumid]/s$session[sessionhash]">$forum[title]</a>
<a href="$bburl/t$thread[threadid]/s$session[sessionhash].html">$thread[title]</a>
Thanks a lot.
Byron
steven
10-21-2001, 08:28 PM
byron I PM'd you.
Byron
10-22-2001, 12:52 AM
* Byron walking up to the podium. *
Firstly I would like to thank Fastforward for writing this and thanks to steven and auto for the .htaccess.
* Speech end. *
Feedback to those using the .htaccess method.
I have got it running by removing the "s$session[sessionhash]" part in step 2 & 3, using hard coded url for all instances of $bburl and using the the following in my .htaccess.
RewriteEngine on
RewriteRule ^f([0-9]+)/?$ forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^t([0-9]+)\.html$ showthread.php?threadid=$1 [L]
RewriteRule ^t([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=15&pagenumber=$2 [L]
RewriteRule ^f([0-9]+)-([0-9]+)/$ forumdisplay.php?forumid=$1&daysprune=1000&sortorder=&sortfield=lastpost&perpage=40&pagenumber=$2 [L]
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]
Step 2 & 3
<a href="$bburl/f$forum[forumid]/">$forum[title]</a>
<a href="$bburl/t$thread[threadid].html">$thread[title]</a>
That's all.
Wait. That's not the end. Need to confirm.
To Fastforward and the rest : Did i miss out anything by using the above .htaccess and removing the "s$session[sessionhash]" in step 2 &3?
Thanks. Cheers to vB. :)
Byron
cyrus
10-22-2001, 08:08 AM
i dont get it
i downloaded the install txt
what the hell is httpd.conf ? :)
and I dont get any of the other instructions either
can someone make a dummys guide of it for me ??
thank you
Haakon
10-30-2001, 10:19 AM
I`ve implemented the hack temporarily through .htaccess , and it seems to works great. Especially seeing that PR* only drops one level from inedex to any thread. Currently it drops two from index to category, but this is unnecessary, and can be fixed by just deleting this slash:
<a href="$bburl/f$forum[forumid]/">$forum[title]</a>
<a href="$bburl/f$forum[forumid]">$forum[title]</a>
One thing I would really like to see implememnted into the hack, is the code for rewriting the path to the next pages of threads listed, like
"Pages (3): [ 1 2 3 > "
would get SE friendly. The current code is quite wast and it`s dynamic so I don`t know if it`s possible, is it?
Like
http://www.radiomute.com/forumdisplay.php?s=&forumid=26&daysprune=1000&sortorder=&sortfield=lastpost&perpage=25&pagenumber=2
could be transformed into http://www.radiomute.com/f261000252 ?
Then all threads would be crawled :D
*PR= Page Rank, used by google as the main meassure of page importance. The higher, the better!
I read the whole thread from the beginning and I'm confused now. I really want to install this hack, but everyone is saying something different. What is the easiest way to implement this hack? I can do it via httpd.conf. I'd really appreciate it if someone could post the final instructions.
Thanks
tamarian
11-12-2001, 11:37 PM
I've installed this, with Byrons mods and it worked fine for many browsers, except Netscape 4.7. It doesn't download the images and show image coding errors.
I've removed it until I can find a work around. Any ideas?
amykhar
11-21-2001, 07:55 PM
With auto's help, I got this installed and working on my board :)
My question is why doesn't it work if I use the sessionhash part of the url? If I strip that out, it works fine. With it, I get page not found.
(I am using .htaccess)
Amy
amykhar
11-21-2001, 11:52 PM
Has anybody goes who's online straightened out to recognize these urls?
Amy
eva2000
11-23-2001, 04:32 AM
Originally posted by amykhar
Has anybody goes who's online straightened out to recognize these urls?
Amy not yet.. i just leave as is
amykhar
11-23-2001, 12:53 PM
Originally posted by eva2000
not yet.. i just leave as is
rats. :D Looks like I have some work to do then huh?
Amy
amykhar
11-24-2001, 09:53 PM
Ok. This is HIGHLY experimental, but I think I have who's online fixed.
In online.php find:
$loc=preg_replace("/\?s=[a-z0-9]{32}(&)?/","?",$loc);
add after:
$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);
Thus far, it's working on my board. But I promise nothing. :D
Amy
Haakon
12-01-2001, 02:57 PM
amykhar: I see that you`ve gotten the hack to work on threads that contain more pages. My additional pages in threads doesn`t respond to the hack.
The original code was:
RewriteRule ^t([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=15&pagenumber=$2 [L]
Could you please paste in the code you are using?
amykhar
12-01-2001, 03:05 PM
I got mine from Auto :)
RewriteEngine on
RewriteRule ^f([0-9]+)/?$ forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^t([0-9]+).html$ showthread.php?threadid=$1 [L]
RewriteRule ^t([0-9]+)-([0-9]+).html$ showthread.php?threadid=$1&perpage=15&pagenumber=$2 [L]
RewriteRule ^f([0-9]+)-([0-9]+)/$ forumdisplay.php?forumid=$1&daysprune=1000&sortorder=&sortfield=lastpost&perpage=40&pagenumber=$2 [L]
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]
Amy
amykhar
12-10-2001, 12:03 PM
Yay! It seems to have worked. Google just spent a very long time crawling my board. :)
I still haven't gotten myself back to Netscape compatiblity though. Did anyone find a way to do it without requiring all the templates to be edited?
Amy
eva2000
12-11-2001, 02:53 AM
my forum has 24,000 - 26,000 pages indexed by google :D
Does the first post of this hack work? Or do I need to read through all thep ages and install fixes ti run this on 2.2.1? Thanks
tamarian
12-12-2001, 03:51 AM
Eva, do you get complaints from Netscape users? I got a few from 3.x users so I removed the hack.
Might put it back again, and create a seperate template for Nutscape 3.x users, but if I can fix it, it would be much better.
tamarian
12-12-2001, 03:53 AM
Originally posted by LuBi
Does the first post of this hack work? Or do I need to read through all thep ages and install fixes ti run this on 2.2.1? Thanks
I tried the one from this post, and it worked great.
https://vborg.vbsupport.ru/showthread.php?postid=190131#post190131
Only problem is for Netscape 3.x users, ifor those who care about them :)
amykhar
12-12-2001, 05:18 PM
DAMMIT ALL TO HELL! Ventures online will be disabling mod rewrite on my server. Google FINALLY indexed me, and now the links aren't going to work.
They turned it off today for a while and killed my entire board.
Grrrrrrrr!
Amy
Originally posted by tamarian
I tried the one from this post, and it worked great.
https://vborg.vbsupport.ru/showthread.php?postid=190131#post190131
Only problem is for Netscape 3.x users, ifor those who care about them :)
I really don't understand those instructions.. I need to make an .htsccess? Doesn't seem to difficult, and this would make my site very powerful compared to my competition so please help peoples I'm slow. :rolleyes: :D ;)
tamarian
12-13-2001, 01:45 AM
Amy,
Would you please share your changes? Your forum handles Nutscape 4.x a lot better than mine.
Is it a baseref tag or specific replacements.......
TIA
amykhar
12-13-2001, 01:55 AM
tamarian,
I have slowly been going into the templates and changing the urls from relative to absolute. However, I have barely gotten any done because of time constraints and a deep lack of motivation.
Now that it looks like Ventures Online is going to zap my mod_rewrite, I probably won't work on it anymore. :(
Amy
tamarian
12-13-2001, 02:04 AM
Originally posted by amykhar
[B
Now that it looks like Ventures Online is going to zap my mod_rewrite, I probably won't work on it anymore. :(
[/B]
If you're looking for a better host, checkout hostingmatters.com
No affiliation, just a happy customer. :)
Silviu
12-13-2001, 09:18 AM
Any Win2k/IIS version for this hack ? :)
chaz7979
12-17-2001, 08:29 AM
Can't most spiders read the ? mark links now anyway?
Howard
12-31-2001, 11:22 AM
I just tried this hack on my v2.2.1 vb with both the .htaccess and httpd.conf methods. The forum urls look fine (ie http:/www.howardforums.com/f1/) however all the image links except the forum logo have stopped working. Any ideas?
Howard
12-31-2001, 06:48 PM
Oh yeah I forgot to mention, the page is spitting out images that are located in directories like this: http://www.howardforums.com/f4/images/... instead of http://www.howardforums.com/images...
LanciaStratos
01-02-2002, 11:01 PM
This great hack desparately needs a update - I don't have a clue where to start on this! Could someone please wrap all this up in one new hack, and eliminate the confusion? It would definitely be appreciated by many people! :)
chaz7979
01-03-2002, 02:36 AM
I'm with LanciaStratos on this one.
fastforward
01-06-2002, 04:53 AM
Originally posted by LanciaStratos
This great hack desparately needs a update - I don't have a clue where to start on this! Could someone please wrap all this up in one new hack, and eliminate the confusion? It would definitely be appreciated by many people! :)
I intend to revisit this very shortly. I've finally started to prepare for upgrading my forums to 2.2.1. It will probably be a couple of weeks though.
LanciaStratos
01-06-2002, 02:55 PM
Originally posted by fastforward
I intend to revisit this very shortly. I've finally started to prepare for upgrading my forums to 2.2.1. It will probably be a couple of weeks though. Great!!! I can't wait - best of luck upgrading your forums!!! :D
eva2000
01-06-2002, 03:53 PM
Originally posted by Howard
I just tried this hack on my v2.2.1 vb with both the .htaccess and httpd.conf methods. The forum urls look fine (ie http:/www.howardforums.com/f1/) however all the image links except the forum logo have stopped working. Any ideas? read my solutions very early in this thread.. i have the hack installed for ages on 2.2.0 modified and it works like a charm
chaz7979
01-06-2002, 03:59 PM
Doesnt google spider urls with ? now anyway?
fastforward
01-06-2002, 05:54 PM
Originally posted by eva2000
read my solutions very early in this thread.. i have the hack installed for ages on 2.2.0 modified and it works like a charm
I think the issue is with multipage threads. My initial release only rewrote the first page of links.
The difficulty is not so much rewriting the links, it's maintaining the other options such as 'perpage' and sort order etc.
LanciaStratos
01-06-2002, 05:55 PM
Originally posted by chaz7979
Doesnt google spider urls with ? now anyway? You know, I've seen plenty of sites with a "?" in the URL, (some even with forums like phpBB), on Google and they got indexed just fine... :confused: Would someone care to explain this?
fastforward
01-06-2002, 05:57 PM
Originally posted by chaz7979
Doesnt google spider urls with ? now anyway?
You'll get a higher page rank with 'mysite.com/t127634.html' than if you used the normal url. Besides, google isn't the only searchengine out there.
chaz7979
01-06-2002, 06:21 PM
Oh I know google isnt the only one out there but they are one of the only ones who was thought to have problems with the ? question marks.
eva2000
01-09-2002, 05:20 AM
Originally posted by fastforward
I think the issue is with multipage threads. My initial release only rewrote the first page of links.
The difficulty is not so much rewriting the links, it's maintaining the other options such as 'perpage' and sort order etc. i see.. i'm happy with first page indexing only anyway :)
Prince
01-10-2002, 12:44 AM
Originally posted by fastforward
Besides, google isn't the only searchengine out there.
No it's not, but it's the most important search engine!
LanciaStratos
01-20-2002, 04:32 PM
Originally posted by fastforward
I intend to revisit this very shortly. I've finally started to prepare for upgrading my forums to 2.2.1. It will probably be a couple of weeks though. Hey fastforward, are you still planning on revisiting this hack? :)
tamarian
01-21-2002, 04:56 PM
Hi folks,
I have an idea to make this hack more powerful, and require a new addition to this hack, possibly in the code.
I thought of this after I noticed I had many Netscape 4.x users, so I created new style set for them, and placed a link on the main page to "Fix Netscape errors" which simply sets their style id to use the original vB dynamic links.
This makes spiders and most surfers use the new (spider friendly) links, while those who click the "Fix link" can use original vB links in their templates.
The disadvantage, is that some users post links to other thread in spider-friendly format, that other members have trouble accessing if they have Netscape.
What I would like to do, instead, is this:
Detect if the visitor is using a browser agent (IE, Netscape, Mozilla), and if so, set their id to use a default style set (with vB's dynamic links)
If the user agent is other than (Mozilla-compatibele) then use a special style id that contain spider-friendly templates.
It initially sounded easy to me, but then I though that spider robots cannot be cookied, and any style id I assign them in my index.php code, may have to be re-checked in other parts of the code beside index.php? i.e. showthread etc.
Is there an easy way of accomplishing this?
tpearl5
02-02-2002, 03:41 AM
I had to modify a couple things in the links to get everything working properly.
This may apply to 2.2.2, however I'm not positive:
In my .htaccess file I have:
RewriteEngine on
RewriteRule ^f([0-9]+)/?$ forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^t([0-9]+)\.html$ showthread.php?threadid=$1 [L]
RewriteRule ^t([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=15&pagenumber=$2 [L]
RewriteRule ^f([0-9]+)-([0-9]+)/$ forumdisplay.php?forumid=$1&daysprune=1000&sortorder=&sortfield=lastpost&perpage=40&pagenumber=$2 [L]
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]
In forumhome templates I have:
<a href="$bburl/midiboard/f$forum[forumid]">
(midiboard is subdirectory of site)
In forumdisplay templates I have:
<a href="$bburl/f$forum[forumid]">
And in forumdisplaybit:
<a href="$bburl/t$thread[threadid].html">
Also the base href tag in the head include needed an extra trailing slash to make images work. Other then that everything seems to be okay.
tamarian
02-02-2002, 01:39 PM
Originally posted by tpearl5
Also the base href tag in the head include needed an extra trailing slash to make images work.
Tpearl, we have been slaving on this trying to fix it for old Netscape browsers, and none of us cought the missing slash problem.
Thanks! :up:
tpearl5
02-02-2002, 08:10 PM
Wow.. I didn't know it was a problem. ;) Images didn't work in MSIE without that slash for me.
tamarian
02-02-2002, 08:38 PM
Originally posted by tpearl5
Wow.. I didn't know it was a problem. ;) Images didn't work in MSIE without that slash for me.
They worked fine for IE's, but Netscapes 4.7 and earlier had a problem with them.
I even started hacking the sessions and redirecting to different style id's based on user agents! Currently, registered members get the vB dynamic links, and guests get the spider-friendly ones.
I'll keep it that way, but I'll remove the link to Netscape upgrade.
That's always the case with debugging, you look hard for difficult mistakes, and they turn out to be too obvious to catch ;)
tpearl5
02-03-2002, 12:33 AM
I just changed the link in forumdisplay_multipagenav_pagenumber
to
$bburl/t$thread[threadid]-$acurpage.html
Now I have short URL's to multi page threads :)
MarkB
02-20-2002, 04:27 AM
Just installed this, and it works great - just two questions:
How can I fix it so Who's Online displays where a user is instead of Unknown Location: /forum/t15321/s7406f2d946ce71b342e89b3a9607ac99.html?
Also, would it be at all possible to hack this so, instead of www.yourdomain/forum/f13/ it has www.yourdomain.com/forum/chat/ (where "chat" is the forum title)? That'd be a huge improvement, I think :)
But, I have to say that - as it stands - this is great! :)
hmm...Im still having trouble,
my dir is www.domain.com/forums - help!
slinky
03-01-2002, 12:58 PM
Mmmm... can't help you with a problem we don't know about! Also, your site's forums don't appear...
me? I was testing the hack and my forums are www.designerchat.net/forums
I was just using www.domain.com/forums as an example
Is there a (nearly) final version of this ?
After reading ~140 posts there is nothing but confusion about problems with images and netscape and what ever ...
Does an "any browser" solution exists or not ?
greets
slinky
03-02-2002, 03:22 PM
Many are using this without a problem, including myself.
Could you please paste your code?
slinky
03-03-2002, 06:42 AM
The code is exactly the same as you see here.
slinky: what is Your definition of 'here' ;)
slinky
03-03-2002, 10:47 AM
I'm not sure if something here is upsetting you. If you want help with problems that you are having, you need to clearly explain what your problems are. It will probably be more helpful in troubleshooting to provide an explanation rather than just a reference to your site.
Admin
03-16-2002, 12:55 PM
Just installed this here, seems to be working great. :)
fastforward
03-16-2002, 01:57 PM
Originally posted by FireFly
Just installed this here, seems to be working great. :)
Not quite... The 'who installed this hack' link isn't working. You'll need to either but bburl or a slash in front of the url. I'm guessing that's probably inside the javascript. The 'base href' in the header doesn't seem to fix everything.
EDIT:
Forget it... Either you just fixed it or there be gremlins on this here site :)
I installed this and get 400 bad request errors. If I use the rewrite rule from the zip I get 500 error and in error log it says it can't parse regex. I used the modified rules and then I get 400 error. Anyone know what the problem might be?
leebo
03-22-2002, 12:41 PM
Any chance of getting it converted to the autohack ( vbhacker )
Thanks :)
Thomas P
05-03-2002, 11:48 PM
Hi there,
I'm trying this the 'n'th time now, meanwhile I switched hosters 3
times and all of them support mod_rewrite.
Nothing ever worked for me, am I that lame? I think so...
I use
RewriteEngine on
RewriteRule ^f([0-9]+)/?$ forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^t([0-9]+)\.html$ showthread.php?threadid=$1 [L]
RewriteRule ^t([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=15&pagenumber=$2 [L]
RewriteRule ^f([0-9]+)-([0-9]+)/$ forumdisplay.php?forumid=$1&daysprune=1000&sortorder=&sortfield=lastpost&perpage=40&pagenumber=$2 [L]
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]
in an .htaccess-file in my forum-directory where all
the vB-files reside.
After placing the htaccess-file i should be able to browse my board by typing in
something like http://mcseboard.de/f3 which should get me
http://www.mcseboard.de/forumdisplay.php?&forumid=3 - it doesn't
What's wrong here?
Thanks for any hint,
-Tom
P.S.: My URL isn't domain.com/forum but straight domain.com
That's the only difference I can see to a standard vB installation.
mano1.com
05-31-2002, 03:00 AM
what is the latest version of this hack? There are so many posts I am not sure if I'd be up to date downloading the original file posted.
Thanks for letting me know
:)
Kyle_TX
06-17-2002, 05:25 PM
I want to install this, however I have a quick question.
Is this going to affect my current search engine listings?
The Piper
06-20-2002, 08:28 PM
I compiled all the information regarding spider friendly URLs using .htaccess into one file, since a lot of people (including myself) were feeling a bit lost.
Please notice I do NOT claim any authorship on anything here. I merely copied a lot of information from a lot of threads into one file.
There may be errors, so I don't guarantee anything. You are using this on your own risk. It's working at my site, so I hope it works for you. One last thing, since I didn't create any of this, I won't be supporting anything, because I'm a newbie and I don't have much time. Just thought I'd contribute with my 2 cents.
Many thanks to all the people who helped me make this work on my site.
Shine on!
Paulo
jon2x
06-21-2002, 04:37 PM
<waffle>
just a thought....
by replacing:
<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">
with
<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:
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:
$loc=preg_replace("/?s=[a-z0-9]{32}(&)?/","?",$loc);But only found this, on 2.2.6:$loc=preg_replace("/\?s=[a-z0-9]{32}(&)?/","?",$loc);I've tried adding $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
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
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:
Edit httpd.conf and use Eva2000's latest rules: ie.
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]
Add the following line to your 'Head Insert' template:<base href="$bburl">
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
Change the links to look like this:
<a href="$bburl/f$forum[forumid]/s$session[sessionhash]">$forum[title]</a>
Edit the following template:
forumdisplaybit
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/
Paul, how do we fix the Unknown Location Fields showing up in WOL page?
TIA :)
fastforward
10-06-2002, 11:17 PM
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:
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';
}
}
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
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
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. :(
* Velocd snaps his fingers then walks away
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
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
[QUOTE]Originally posted by eva2000
got it to work now with this
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]
[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:
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';
}
}
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:
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:
// 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.
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. :)
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
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
The addition of the following code to postings.php will allow you to use the search-engine friendly URLs to merge threads:
Below:
// get other threadid
$getthreadid=intval(substr($mergethreadurl,strpos( $mergethreadurl,"threadid=")+9));
Insert:
// Hack: Work with search-engine friendly links
$getsearchfriendlythreadid=intval(substr($mergethr eadurl,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. :)
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
Just to show this hack actually works and works well
fello9
12-05-2002, 09:47 PM
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?
Erwin
12-06-2002, 02:05 AM
You need to edit your postings.php - there is a post in this thread on how to do this already.
The Piper
12-06-2002, 09:47 AM
Originally posted by Erwin
You need to edit your postings.php - there is a post in this thread on how to do this already.
I installed this fix, and although I haven't even tested it, it only works for merging threads. I still get the same problem when trying to move threads, the forumjump doesn't show up, so all I get is a link to "Please select forum:", and no forum shows up. That is, I can't move threads at all. Any help would be greatly appreciated.
Erwin
12-06-2002, 11:01 PM
This hack doesn't affect forumjump, so I don't know why your forumjump is like that to be honest.
fastforward
12-07-2002, 01:36 AM
Originally posted by The Piper
the forumjump doesn't show up, so all I get is a link to "Please select forum:", and no forum shows up. That is, I can't move threads at all. Any help would be greatly appreciated.
Have you set <base href="http://yoursite.com/forum/">
in the header?
If that still doesn't work, you may have to edit the window.location() javascript functions in the templates and prefix them with a forward slash or the forum url.
fello9
12-10-2002, 05:53 AM
Anyone knows what I need to code the "page navigation" numbers to be Search Engine Friendly?
I know it can be done, because I saw these guys have done it at: http://www.techimo.com/forum/f3/index.html . This links look
like this:
http://www.techimo.com/forum/fid3/dp1000/so/sflastpost/pp50/pn2/index.html .
tpearl5
12-23-2002, 06:31 PM
I ran into a new problem. I recently changed servers and it seems as though mod_rewrite isn't working at all. Every page comes up with a 404.
Take a look: http://board.midibuddy.net
No links work!! AHH!!
mod_rewrite is enabled on the server. Everything should work fine, right? This is what my .htaccess file looks like:
RewriteEngine on
RewriteRule ^f([0-9]+)/?$ forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^t([0-9]+)\.html$ showthread.php?threadid=$1 [L]
RewriteRule ^t([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=15&pagenumber=$2 [L]
RewriteRule ^f([0-9]+)-([0-9]+)/$ forumdisplay.php?forumid=$1&daysprune=1000&sortorder=&sortfield=lastpost&perpage=40&pagenumber=$2 [L]
RewriteRule ^[ft]([0-9]+)/s([^/]*)/(.+)$ /$3 [L]
HELP!!! :eek:
codewebs
01-05-2003, 02:39 PM
i know this is a old post, but when i use the fix for whos online it says viewing thread without the link to the thread and the same as viewing forum
Hi guys
Geat hack.....its the sole reason why i converted from yabbse to vbulletin yesterday :)
I've installed it but i think its still using sessions http://www.cyclingforums.com/f48/s isnt this a problem for google?
It would be good to be able to get rid of sessions unless they were required
great hack btw :)
cheers!
fastforward
01-16-2003, 12:36 PM
Originally posted by cyc
Hi guys
Geat hack.....its the sole reason why i converted from yabbse to vbulletin yesterday :)
I've installed it but i think its still using sessions http://www.cyclingforums.com/f48/s isnt this a problem for google?
It would be good to be able to get rid of sessions unless they were required
great hack btw :)
cheers!
You probably don't want to rely on the file in the first post. :) Use the following rewrite rules and make sure you change all the templates to remove any passing of the sessionhash. Obviously you will also need to force everybody to use cookies on your board.
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]
Haakon
01-16-2003, 02:07 PM
This hack is even better than you think cyc, my small board gets about 1000 uniques a day because of this genious hack (got to have some page rank though, which you have) :D
But I really want to second fello9`s question about the secret to enable this hack for page navigation. Do you have an idea fastforward, or anyone?
Thanks,
Haakon
fastforward
01-16-2003, 02:27 PM
Originally posted by Haakon
But I really want to second fello9`s question about the secret to enable this hack for page navigation. Do you have an idea fastforward, or anyone?
Check page 8 of this thread for a post by amykhar.
I will try and update the file sometime soon to reflect all the bug fixes and additions that people have contributed.
Haakon
01-16-2003, 02:40 PM
That was me asking that same question back then :); but it didn`t do anything to my board, so I ask again ;)
fastforward
01-16-2003, 02:44 PM
Originally posted by Haakon
That was me asking that same question back then :); but it didn`t do anything to my board, so I ask again ;)
oops.. sorry :ermm:
I'll make a commitment and promise to find a solution this week. I promise to have something by next Wednesday.
I could make use of that feature myself actually.
Haakon
01-16-2003, 02:50 PM
Thanks!, that`s great fastforward.
But I see now that amykhar got it working, maybe you could test it, maybe it`s just my site.
I use htaccess, it would be great if you find a solution!
Thanks,
Haakon
how do you force everyone to use cookies?
I've added the new rewrite rule and deleted the sessionhash from the templates, but in the users online section I can still see some users browsing with sessions :ninja:
cheers!
NTLDR
01-16-2003, 08:02 PM
You can't force them to use cookies, they can block them on there machine if they want to.
Originally posted by NTLDR
You can't force them to use cookies, they can block them on there machine if they want to.
I realise that......however googlebot is at my website now but in the online users sectinos its showing up as http://www.cyclingforums.com/f26?=fa3206ca9c9ac177f00b43e091389c38 rather than http://www.cyclingforums.com/f26
Most users are showing with the short url.
cheers!
Haakon
01-17-2003, 02:59 PM
Cyc, the googlebot gets a little confused the first month, so you might experience that it crawls both rewritten urls and normal ones. At least it did this with my site the first months, but it won`t hurt you.
NTLDR
01-17-2003, 03:09 PM
Originally posted by cyc
I realise that......however googlebot is at my website now but in the online users sectinos its showing up as http://www.cyclingforums.com/f26?=fa3206ca9c9ac177f00b43e091389c38 rather than http://www.cyclingforums.com/f26
Most users are showing with the short url.
cheers!
If you take a closer look at the sessionhash in unknown urls then you will find its your sessionhash and doesn't mean that the googlebot has one.
Has anyone set this up so guests get the rewritten urls and members get the normal urls? is this even possible?
cheers!
cobradude
01-23-2003, 02:22 AM
Originally posted by cyc
Has anyone set this up so guests get the rewritten urls and members get the normal urls? is this even possible?
cheers!
Assign a default style with these mods to your not logged in group, and assign another style without the mods to your members.
You'll need to install this hack to assign styles to usergroups: https://vborg.vbsupport.ru/showthread.php?s=&threadid=32857&highlight=styles
Gutspiller
01-25-2003, 03:01 PM
Can somebody help me? I don't understand what I'm suppose to do in step one. Can somebody give me some more in-depth intructions on step one? What exactly am I suppose to do? Please help, I would really like to install this hack. :(
lierduh
01-30-2003, 09:16 AM
Edit: 13 Dec 2003, posted some notes about VB version 3 Beta 7.
https://vborg.vbsupport.ru/showpost.php?p=451681&postcount=298
Edit: 26 July 2003, buro9 has found and fixed quite a few bugs, he has also made improvement. Please refer to his post at:
https://vborg.vbsupport.ru/showthread.php?postid=418257#post418257
Edit: 9 Feb 2003, added RewriteCond to fix search result navigation problem.
Edit: 5 Feb 2003, added RewriteCond to fix member list navigation problem.
Edit: 2 Feb 2003, added hack to the forums/threads page navigation links to cover more threads. Change made to pagenumber and perpage's position from my initial post.
===========
I will share my experience with this hack.
My web server is running apache.
First of all, your web server needs to have mod_rewrite module installed and enabled.
I put rewrite rules in .htaccess (in httpd.conf should be the same)
I decided not to use session ID. I will explain this later.
First, for .htaccess to work, you need to enable it with "AllowOverride" in your httpd.conf file. My AllowOverride line looks like this:
AllowOverride AuthConfig Options FileInfo
Naturally
AllowOverride All
will work too.
For Redhat and Mandrake Linux, httpd.conf file is located under:
/etc/httpd/conf/
If you don't know where is yours, try:
#locate httpd.conf
For those of you who can not access to httpd.conf file, eg. use someone else's server etc, .htaccess is a better option.
I use .htaccess for different settings including php options for different software. You may only want rewrite rules for a certain software, not everything under the same domain!
My rewrite rules extracted from .htaccess:
RewriteEngine on
RewriteRule ^f([0-9]+)\.html$ forumdisplay.php?forumid=$1 [L]
RewriteRule ^f([0-9]+)-([0-9]+)\.html$ forumdisplay.php?forumid=$1&daysprune=30&sortorder=&sortfield=lastpost&perpage=25&pagenumber=$2 [L]
RewriteRule ^t([0-9]+)\.html$ showthread.php?threadid=$1 [L]
RewriteRule ^t([0-9]+)-([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=$2&pagenumber=$3 [L]
RewriteRule ^t([0-9]+)-([0-9]+)--(.*)--([0-9]+)\.html$ showthread.php?threadid=$1&perpage=$2&highlight=$3&pagenumber=$4 [L]
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]
Why don't I use session ID?
The Googlebots hate the most is session ID. As soon as they remotely detect there is an session id, they turn around and go away. This is why no vBulletin boards will be indexed. I have got a feeling that if the session id is removed, even with no rewrite hack and with the "?" in the URL, google will index the forums. The reason why Googlebots do not like session ID is: Each time the bot visits, for the same contents, it will be fed with different URL. Sometimes more than one bots might visit at the same time. They might be pulling the same page with different URL! I also believe Google punishes with lowered PR rating for those web sites that have different URLs for the same page. So even if you do rewrite session IDs as part of URL, the bots will get different URLs for the same page, when they process the data and find out, they will give your site a lowered PR rating, with passion! as your site has wasted a lot of their time.:)
The second reason for not using session ID is security. Imagine this, you have your cookies turned off, you go to this forums, log in and find something good, you subsequently copy the URL of one of the thread and paste in a post. As the session ID carries your Logged in ID. Now if someone else who has not even logged in click on the URL you just posted, he becomes you, he can then post under your name! Tell this to your members, then you will have no problem forcing them to turn on the cookies.:)
You will notice for the forums, I also use .html as the forums page instead of the original directory structure for the forums. Google lowers PR rating for each directory layer, so don't let the "/" get in the way. Also with "/", you will have image display problems etc. As the displayforums.php is in the root directly, now your page is "/f10298740/" .
The following templates need to be changed:
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
usercp_forumbit
Find
forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]
Replace it with:
f$forum[forumid].html
For forumdisplaybit template,
Replace
<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a>
with
<a href="t$thread[threadid].html">$thread[title]</a>
For forumdisplay_multipagenav_pagenumber
Replace
<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]&perpage=$pperpage&pagenumber=$acurpage">$acurpage</a>
with
<a href="t$thread[threadid]-$pperpage-$acurpage.html">$acurpage</a>
To fix "Who is online" problem.
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);
I will post more information when I find more problems with the hack. Hope my experience helps someone. :cool:
========= Edit: added the hack for forumdisplay.php navigation links
Fix Forums Navigation links:
open forumdisplay.php
Find
$pagenav =
getpagenav($totalthreads,"forumdisplay.php?s=$session[sessionhash]&forumid=$forumid&daysprune=$daysprune&sortorder=$sortorder&sortfield=$sortfield&perpage=$perpage");
replace it with:
$pagenav = getpagenav($totalthreads,"f$forumid");
Change the following templates as well.
pagenav_firstlink
find: <a href="$address&pagenumber=$curpage" title="first page">
change to: <a href="$address-$curpage.html" title="first page">
pagenav_lastlink
find: <a href="$address&pagenumber=$curpage" title="last page">
change to: <a href="$address-$curpage.html" title="last page">
pagenav_nextlink
find: <a href="$address&pagenumber=$nextpage" title="next page">
change to: <a href="$address-$nextpage.html" title="next page">
pagenav_pagelink
find: <a href="$address&pagenumber=$curpage">$curpage</a>
change to: <a href="$address-$curpage.html">$curpage</a>
pagenav_prevlink
find: <a href="$address&pagenumber=$prevpage" title="previous page">«</a>
change to: <a href="$address-$prevpage.html" title="previous page">«</a>
=============
Open showthread.php
find:
$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage".iif(isset($highlight), "&highlight=$highlight", ""));
change it to:
$pagenav = getpagenav($totalposts,"t$threadid-$perpage".iif(isset($highlight),"--$highlight-", ""));
Haakon
01-30-2003, 02:27 PM
Thanks, especially for the multi page addon I really needed that.
Cheers,
Haakon
Hi,
Thats a very handy post!
I cant get the forumdisplay_multipagenav_pagenumber bit to work, i get a 404 error when going to the new short url's. Everything else has been working great for the last week or so :banana:
cheers!
lierduh
01-31-2003, 07:03 AM
Originally posted by cyc
Hi,
Thats a very handy post!
I cant get the forumdisplay_multipagenav_pagenumber bit to work, i get a 404 error when going to the new short url's. Everything else has been working great for the last week or so :banana:
cheers!
Post your rewrite rules and the URL causing page 404.:)
Originally posted by lierduh
Post your rewrite rules and the URL causing page 404.:)
Current rewrite rules from the httpd.conf file are:
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]
RewriteRule ^t([0-9]+)-([0-9]+)-([0-9]+)\.html$ showthread.php?threadid=$1&perpage=$3&pagenumber=$2 [L]
goto http://www.cyclingforums.com/f47 and click on a number in the top thread.
cheers!
lierduh
01-31-2003, 11:17 PM
Originally posted by cyc
Current rewrite rules from the httpd.conf file are:
RewriteEngine on
RewriteRule ^/f([0-9]+)/?$ /forumdisplay.php?forumid=$1 [L]
goto http://www.cyclingforums.com/f47 and click on a number in the top thread.
cheers!
Your rewrite rule is waiting for:
http://www.cyclingforums.com/f47/
not
http://www.cyclingforums.com/f47
So either you need to add a '/' to your template or just make your rewrite rule to:
RewriteRule ^/f([0-9]+)$ /forumdisplay.php?forumid=$1
Your rewrite rule is looking for:
URL matches (between "^" and "$") which is /f123/xxx
Try
^/f([0-9]+)$ or ^f([0-9]+)$
lierduh
02-02-2003, 12:33 AM
The original hack does not change the forums/threads' navigation links. ie.
Pages (5): « First ... « 3 4 [5]
Pages (26): « First ... « 23 24 [25] 26 »
So basically the bots can only craw the first page of a single forum. With my addtional hack, the bots will be able to crawl all the threads specified by "Last 30 days" or whatever the default setting is.
This also allows every thread to be crawled even if they are spreaded through more than 4 (or 9) pages.
I have edited my original post to include this hack.
Haakon
02-04-2003, 07:33 AM
Thanks again lierduh, can`t imagine the increase in visitors for next month :)
However, there is a little problem with the last hack (I think it`s the last one). If you look in member list, the page button is now disabled. Someone spotted it in my forum, and I see you`ve also got the problem. Can you fix it :D
I`ve also got a problem now with some of the thread`s last page will be blank. Not sure if this is because of your hack, but maybe you know something about it?
Thanks,
Haakon
Originally posted by lierduh
The original hack does not change the forums/threads' navigation links. ie.
Pages (5): ? First ... ? 3 4 [5]
Pages (26): ? First ... ? 23 24 [25] 26 ?
So basically the bots can only craw the first page of a single forum. With my addtional hack, the bots will be able to crawl all the threads specified by "Last 30 days" or whatever the default setting is.
This also allows every thread to be crawled even if they are spreaded through more than 4 (or 9) pages.
I have edited my original post to include this hack.
Great job with adding to this awesome hack :banana:
I'm have an issue with the navigation for the thread lists..... http://www.cyclingforums.com/f47 (the links/numbers) would I be right in thinking its a prob with my rewrite rules?
#### edit ####
I've uninstalled the changes that relate to this post, people started complaining about dead links :confused:
thanks
lierduh
02-04-2003, 07:30 PM
Edit: Also added RewriteCond for search.php to make sure multi-page search result work properly.
Originally posted by Haakon
However, there is a little problem with the last hack (I think it`s the last one). If you look in member list, the page button is now disabled. Someone spotted it in my forum, and I see you`ve also got the problem. Can you fix it :D
I`ve also got a problem now with some of the thread`s last page will be blank. Not sure if this is because of your hack, but maybe you know something about it?
Thanks,
Haakon
Please add the following to your existing rewriterules, it should fix the memberlist navigation problem:
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]
Edited my original post to reflect this.:)
Please note, I have changed the positions for the 'perpage' and the 'pagenumber' from my initial post. ie.
It used to be "f123-2-15.html" it is now: "f123-15-2.html"
where 2 is the page number, 15 is 'how many' per page. I changed both the rewriterules as well as the templates to allow me adding the navigation link hack. Please refer to my original post.
lierduh
02-04-2003, 07:38 PM
Originally posted by cyc
I've uninstalled the changes that relate to this post, people started complaining about dead links :confused:
thanks
Please see my recent post regarding 'perpage' and 'pagenumber'.
For all this trouble, Google rewards by sending a bunch of bots everyday hammering the site.:)
BTW, I selected this hack instead of the archive hack because when visitors click on the Google results, they are taken straight to the forums instead of the archive pages.
Erwin
02-04-2003, 11:18 PM
lierduh, I've had your system running on my site for the past few months now... works great - Google has added thousands of my pages into its archive. :)
Originally posted by lierduh
Please see my recent post regarding 'perpage' and 'pagenumber'.
For all this trouble, Google rewards by sending a bunch of bots everyday hammering the site.:)
BTW, I selected this hack instead of the archive hack because when visitors click on the Google results, they are taken straight to the forums instead of the archive pages.
I've tried making your suggested changes 3 or 4 times this morning, it works nice except the page links on a thread that spans more than one page.
The same page nav works fine when on the page with the thread headings, just not the threads themselves. BTW i've uninstalled it again cause me users hate dead links :laugh: I'm not using .htaccess because i run the server its on and therefore can edit the conf file.
cheers!
lierduh
02-05-2003, 04:14 AM
Originally posted by cyc
I've tried making your suggested changes 3 or 4 times this morning, it works nice except the page links on a thread that spans more than one page.
The same page nav works fine when on the page with the thread headings, just not the threads themselves. BTW i've uninstalled it again cause me users hate dead links :laugh: I'm not using .htaccess because i run the server its on and therefore can edit the conf file.
cheers!
You were close. :)
There is no difference for the Rewriterules between httpd.conf and .htaccess
There are only two areas that could go wrong, that is the templates which generate the URL and the Rewriterule that catches/matches your URL. Again, if you could post the Dead URL and your rewriterules, I might be able to pin point what you did wrong.
Originally posted by lierduh
You were close. :)
There is no difference for the Rewriterules between httpd.conf and .htaccess
There are only two areas that could go wrong, that is the templates which generate the URL and the Rewriterules that catches/matches your URL. Again, if you could post the Dead URL and your rewriterules, I might be able to pin point what you did wrong.
I'll reapply the hack now
##### edit ######
I've got it working, my rewrite rules were alittle messed up.
Thanks for your help, I really appreciate it mate!
*waits for google*
cheers!
lierduh
02-05-2003, 04:30 AM
Originally posted by Erwin
lierduh, I've had your system running on my site for the past few months now... works great - Google has added thousands of my pages into its archive. :)
Erwin, the original hack is created by fastforward, not by me. I merely posted my own experience (see last page) and I believe I might have made some improvement over the origian hack.:)
lierduh
02-05-2003, 04:52 AM
Originally posted by cyc
I've got it working, my rewrite rules were alittle messed up.
Thanks for your help, I really appreciate it mate!
*waits for google*
cheers!
No worries, mate. :) (some downunder talking there)
Glad it is working for you.
Don't forget the last hack (RewriteCond) regarding the memberlist. Otherwise your member list navigation will not work. Fortunately this is a simple one, only need to add two lines to your rewriterules.
Waiting for more things to break, I am sure there is. :) eg. Merge Thread does not work anymore due to the new URL. Do I care to fix this is another question.:)
Erwin
02-05-2003, 07:31 AM
When I say "your" system, lierduh, I mean the multiple page version of this hack. :) I don't use the same hack as you, I've customised my own version.
Originally posted by lierduh
No worries, mate. :) (some downunder talking there)
Glad it is working for you.
Don't forget the last hack (RewriteCond) regarding the memberlist. Otherwise your member list navigation will not work. Fortunately this is a simple one, only need to add two lines to your rewriterules.
Waiting for more things to break, I am sure there is. :) eg. Merge Thread does not work anymore due to the new URL. Do I care to fix this is another question.:)
Yep done that now thanks for the tip!
I'm thinking I might as well kill my archive now :smoke:
cheers mate!
Haakon
02-06-2003, 08:27 AM
Hi lierduh, sorry to bother you about this. But I need some help concerning the approvements you`ve done to the spider friendly hack. I`ve gone through all the steps in your hack, it works great in every area except one, the forumdisplay part.
The first problem is with multipage threads, in forumdisplay it will only show a error page if I click the page buttons. I`ve disabled that hack but the url shows something like "f123--2" which is strange. Any theories about this one? What should I check?
The second problem is that the pagenumber buttons are a bit funky, test this one http://www.radiomute.com/f112-3.html. Click on different pages, unexplainable :)
I`m completely aware that this is not your problem, as I can see you`re hack works perfect for everyone else, but I don`t understand this though I`ve looked into it.
Cheers,
Haakon
lierduh
02-06-2003, 09:24 AM
1.
I presume you mean the multiple page thread links displayed under a forumdisplay.
It should be something like t3593-15-5.html
If you had it as: f123--2
then your template is not done properly. The template you need to change is:
================
For forumdisplay_multipagenav_pagenumber
Replace
<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]&perpage=$pperpage&pagenumber=$acurpage">$acurpage</a>
with
<a href="t$thread[threadid]-$pperpage-$acurpage.html">$acurpage</a>
======================
2.
My original rewriterule set the "daysprune=30" (the second rewriterule). Your default setting for "Default view age" is "Last Day". You need to make them the same.
My own forums setting at the moment is "the beginning" for the "Default view age" and the rewriterule is "daysprune=1000"
That will show all the threads, making them all ready to feed the Googlebots.
You can set "Default view age" for each forum through Admin panel, click Modify forums and then "setting". As the side note says, 1000 means from the beginning.
Haakon
02-06-2003, 10:13 PM
Hi, changed the rewrite rule to my settings and it works with no funky behavior..... thanks!
The 1st problem didn`t get solved though. It`s like it dosn`t recognize the $pperpage variable. The pages will get spidered from the showthread templates though, so it`s no krisis.
Thanks again,
Haakon
cobradude
02-09-2003, 09:45 PM
Is there a way to NOT monkey with the links for multiple pages for memberlist or search? I block the bots for those anyway, and the more rules I have, the easier it will be to break down the road. Any solutions?
lierduh
02-09-2003, 10:12 PM
Originally posted by cobradude
Is there a way to NOT monkey with the links for multiple pages for memberlist or search? I block the bots for those anyway, and the more rules I have, the easier it will be to break down the road. Any solutions?
Unfortunately the navigation link templates are used for all the multiple pages. So the additional rules for memberlist and search are necessary. Fortunately they are only rules to add without the need to muck around with templates or scripts. I think the additional rules are pretty safe.
If you do not want the robots to index your memberlist or search results (I don't think they will go and fill your search terms anyway). Just create a robots.txt (http://www.robotstxt.org/wc/robots.html) file and they won't bother.
The Piper
02-11-2003, 01:47 PM
First, I'd like to thank lierduh for reworking the original hack. It's finally working like a charm on my site.
I'm having one bit of a problem, though. I've noticed, by looking at Who's Online, that some users have unknown locations such as those:
/t2094-3.html ? s = xxxxxxxxxxxxxxxxxxx
/f8 ? s = xxxxxxxxxxxxxxxxxxx
/f13 ? s = xxxxxxxxxxxxxxxxxxx
Note: Extra spaces added, because vB.org removes the session part, when posted as it is. xxxxxx in place of session as well to avoid problems. :)
I was using the original version of the hack, so I used to have URLs like http://www.pinkfloydfan.net/f8, instead of http://www.pinkfloydfan.net/f8.html, so the second and third unknown locations might be because of old references that users posted. (Any clue on how to update old references in posts?), but I have no clue of why the first location (/t2094-3.html ? s = xxxxx) is showing up like that.
Any ideas on this? Thanks a lot again!
lierduh
02-12-2003, 09:18 AM
Not sure why the session id is added.
Perhaps you could check the web log, see extractly what URL was accessed, ie. with or without the session id. It may also help you to find out where the link was originated, ie. know as the referrer.
This is probably a stupid question... but where would I find httpd.conf??? I can't find it in anywhere...
dstruct2k
03-13-2003, 03:36 AM
httpd.conf is part of the Apache installation... this mod assumes that you're running your own server....
Too bad it isn't working for me anyways. (Latest version of Apache)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.