0

Ok here is how my .htaccess looks like in /forums directory

=========================

RewriteEngine on
Options +FollowSymLinks
RewriteRule ^thread([0-9]+).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
RewriteRule ^forum([0-9]+).html$ forumdisplay.php?f=$1 [L]
RewriteRule ^forum-one.html$ forumdisplay.php?f=1 [L]

=========================


I am also have a another .htaccess file in the root of my webapge
www.thalforum.com

which uses 301 option to forward the users from www.thalforum.com/index.php to www.thalforum.com/forums

I will welcome any assistance i get on this.....

0

Remove goto=newpost&
Remove RewriteRule ^forum-one.html$ forumdisplay.php?f=1 [L]

Try it then.

0

I have installed and .. and on testing it I am gettting linked to all pages with 100% accuracy...with NO broken links or URL.

Thanks for Agiacosa, Dani and all others who helped me with this mod..

My /forums has this htaccess file -
====
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]
====


and my root which is forwarding users to /forums as the following htaccess file

==
redirect 301 /index.php http://www.myforums.com/forums/
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]
RewriteRule ^forum-one.html$ forumdisplay.php?f=29 [L]

======


thanks all ..

0

Tdot,

Interesting that it is working for you. I'm still struggling with the new post/last post thing. Now I have a problem with reply emails in that the links don't work.

0

I cant see why the mod wasn't made to effect only guests / non-logged in users... why on earth is it needed for members logged in?

Here (below) is what I used for phpbb and it worked excellently in google - it only effects 'guests' therefore there are no problems with other features, such as merge posts and email functions and the other problems associated with anything when logged in.

##############################################################
## MOD Title: phpBB static URLs mod_rewrite 1.0.0
## MOD Author: Craven de Kere (N/A) http://www.Able2Know.com
## MOD Description: This mod should be added AFTER the Able2Know.com SEO mod
## This mod makes static URLs (only for guests) for phpBB, for example topic-22234.html
## Please read the author notes BEFORE using this mod.
## Check http://www.able2know.com/forums/about15132.html
## for the latest version or to get help with this MOD
##
## MOD Version: 1.0.0
##
## Installation Level: (Advanced)
## Installation Time: 5 Minutes
## Files To Edit: page_header.php,
## Included Files: n/a
##############################################################
## Author Notes:
## Use this mod together with the Able2Know.com SEO Mod (http://www.able2know.com/forums/about15132.html)
## Make backups and test this on a test forum if you can. This is not a typical mod.
## For an additional tutorial on preventing IP addresses from being logged see:
## http://www.able2know.com/forums/about22586.html
##
##############################################################
## MOD History:
##
## 2004-04-10 - Version 1.0.0
## - Initial public release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


#
#-----[ OPEN ]------------------------------------------
#

includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#

//
// Generate logged in/logged out status
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata )
{
ob_start();
function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"'(?<!/)viewforum.php\?f=([0-9]*)&amp;topicdays=([0-9]*)&amp;start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&amp;mark=topics'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;watch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;unwatch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;highlight=*'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;vote=viewresult'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php&amp;p=([0-9]*)'",
"'(?<!/)viewtopic.php\?p=([0-9]*)'",
);
$urlout = array(
"topic-\\1-\\2-\\3.html",
"mark-forum\\1.html",
"updates-topic\\1.html",
"stop-updates-topic\\1.html",
"about\\1.html&amp;highlight=\\2",
"forum-\\1.html",
"ptopic\\1.html",
"ntopic\\1.html",
"view-poll\\1-\\2-\\3.html",
"about\\1-\\2-\\3-\\4.html",
"about\\1.html",
"about\\1-\\2.html",
"about\\1.html",
"post-\\1.html",
"post-\\1.html",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
}

#
#-----[ OPEN ]------------------------------------------
#

includes/page_tail.php

#
#-----[ FIND ]------------------------------------------
#

$db->sql_close();

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}

#
#-----[ OPEN ]------------------------------------------
#

.htaccess

#
#-----[ ADD ]------------------------------------------
#

RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* viewtopic.php?p=$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* viewtopic.php?t=$1 [L,NC]
RewriteRule ^about([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html viewforum.php?f=$1 [L,NC]
RewriteRule ^forum-([0-9]*).* viewforum.php?f=$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next [L,NC]


#
#-----[ OPEN ]------------------------------------------
#

robots.txt

Disallow: forums/post-*.html$
Disallow: forums/updates-topic.html*$
Disallow: forums/stop-updates-topic.html*$
Disallow: forums/ptopic*.html$
Disallow: forums/ntopic*.html$

#
#-----[ OPEN ]------------------------------------------
#

includes/functions.php

#
#-----[ FIND ]------------------------------------------
#

if (!empty($db))
{
$db->sql_close();
}

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata )
{
if (stristr($url, 'http://')) {
header('Location: ' . $url);
exit;
}
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

wish someone would convert it to vB! :-(

0

Tdot,

I'd be very interested to see if you made the following changes to the lastpostby and threadbit templates. I'm trying to debug mine.

AdminCP/FORUM HOME TEMPLATES/forumhome_lastpostby
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$lastpostinfo[lastthreadid]" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="newpostinthread$lastpostinfo[lastthreadid].html" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/THREADBIT TEMPLATES/threadbit
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$thread[threadid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="lastpostinthread$thread[threadid].html">
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="newpostinthread$thread[threadid].html">
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="t$thread[threadid]-$thread.html">
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$thread[threadid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="lastpostinthread$thread[threadid].html">
#

0

Lastpostby Template

<if condition="$show['lastpostinfo']">
<div class="smallfont" align="$stylevar[left]">
    <div style="clear:both">
        <if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
        <a href="newpostinthread$lastpostinfo[lastthreadid].html" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a> 

    </div>
    <div<if condition="is_browser('ie', 6)"> style="float:$stylevar[left]"</if>>
        <phrase 1="member.php?$session[sessionurl]find=lastposter&amp;f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
    </div>
    <div align="$stylevar[right]">
        $lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
        <a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a> 

    </div>
</div>
<else />
<div class="smallfont" align="$stylevar[right]">
    $lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
    <a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a> 

</div>
</if>

threadbit template.

<tr>
    <td class="$altclass"><img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" alt="<if condition="$show['threadcount']"><phrase 1="$thread[dot_count]" 2="$thread[dot_lastpost]">$vbphrase[have_x_posts_in_thread_last_y]</phrase></if>" border="" /></td>
    <if condition="$show['threadicons']">
        <td class="$altclass"><if condition="$show['threadicon']"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /><else />&nbsp;</if></td>
    </if>
    <td class="$altclass" id="t$thread[threadid]" title="$thread[preview]">

        <div>
            <span style="float:$stylevar[right]">
                <if condition="$show['paperclip']"><img class="inlineimg" src="$stylevar[imgdir_misc]/paperclip.gif" alt="<phrase 1="$thread[attach]">$vbphrase[x_attachments]</phrase>" /></if>
                <if condition="$show['subscribed']"><img class="inlineimg" src="$stylevar[imgdir_misc]/subscribed.gif" alt="$vbphrase[you_are_subscribed_to_this_thread]" /></if>
                <if condition="$show['sticky']"><img class="inlineimg" src="$stylevar[imgdir_misc]/sticky.gif" alt="$vbphrase[sticky_thread]" /></if>
            </span>
            <if condition="$show['gotonewpost']"><a href="newpostinthread$thread[threadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a></if>
            $thread[movedprefix]
            $thread[typeprefix]
            <a href="t$thread[threadid]-$thread[url].html"><if condition="$show['gotonewpost']"><strong>$thread[threadtitle]</strong><else />$thread[threadtitle]</if></a>
            <if condition="$thread['pagenav']"><span class="smallfont" style="white-space:nowrap">( <img class="inlineimg" src="$stylevar[imgdir_misc]/multipage.gif" alt="$vbphrase[multipage_thread]" border="0" /> $thread[pagenav] <if condition="$show[pagenavmore]">... <a href="lastpostinthread[threadid].html">$vbphrase[last_page]</a></if> )</span></if>
        </div>

        <div class="smallfont">
            <if condition="$show['threadratings'] AND $show['threadrating']"><span style="float:$stylevar[right]"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$thread[rating].gif" border="0" alt="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" /></span></if>
            <if condition="$show['guestuser']">
                $thread[postusername]
            <else />
                <span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]')">$thread[postusername]</span>
            </if>
        </div>

        <if condition="$show['unsubscribe']">
            <div class="smallfont">
                <a href="newreply.php?$session[sessionurl]do=newreply&amp;t=$thread[threadid]">$vbphrase[reply]</a> |
                <a href="subscription.php?$session[sessionurl]do=removesubscription&amp;return=ucp&amp;t=$thread[threadid]">$vbphrase[unsubscribe]</a>
            </div>
        </if>

    </td>

    <if condition="$show['threadmoved']">
    <td class="$altclass" align="center">-</td>
    <else />
    <td class="$altclass" title="<phrase 1="$thread[replycount]" 2="$thread[views]">$vbphrase[replies_x_views_y]</phrase>">
        <div class="smallfont" style="text-align:$stylevar[right]; white-space:nowrap">
            $thread[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$thread[lastposttime]</span></if><br />
            <phrase 1="member.php?find=lastposter&amp;t=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase>  <a href="lastpostinthread$thread[threadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
        </div>
    </td>
    </if>

    <if condition="$show['notificationtype']">
        <td class="$altclass"><div class="smallfont">
            <label for="sub$subscribethread[$threadid]">$thread[notification]</label>
            <input type="hidden" name="oldemailupdate[$subscribethread[$threadid]]" id="oe_$subscribethread[$threadid]" value="$emailupdate[$threadid]" />
        </div></td>
        <td class="$altclass"><input type="checkbox" name="deletebox[$subscribethread[$threadid]]" id="sub$subscribethread[$threadid]" value="yes" /></td>
    <else />
        <td class="alt1" align="center"><if condition="$show['threadmoved']">-<else /><a href="#" onclick="who($thread[threadid]); return false;">$thread[replycount]</a></if></td>
        <td class="$altclass" align="center">$thread[views]</td>

        <if condition="$show['forumlink']">
            <td class="$altclass"><a href="forumdisplay.php?$session[sessionurl]f=$thread[forumid]">$thread[forumtitle]</a></td>
        </if>
    </if>
</tr>

I hope this helps you determine and fix the problem on your forums.

sry for the deplayed response btw.

|

Edited by Dani: Formatting fixed

0

Thank you. I have the same templates but the problems continue. :-(

Lastpostby Template


threadbit template.


I hope this helps you determine and fix the problem on your forums.

sry for the deplayed response btw.

|

0

Hi, there has been so many fixes for this tutorial. It's already confusing. is there one with all the fixes?

0

Yes, I've asked Dani to let me post it but I have not heard back.

Update, Google has begun to index my keyword rich URLs because of this hack and I'm seeing an improvement in ranking. I wish the other issues could be resolved because the mod is worth it.

0

WOW. I just followed everyone's little fixes and it works like a charm. No problems even on the first run.


By the way, for the page numbers, this is just fine, am I correct?
http://forum.mysite.com/showthread.php?t=436&page=2&pp=10

It would be nice to fix that as well so google will index every page.

Thanks Dani, Keith and the rest!

Time to blow the competition.

0

Hi,

Does anyone have a solution for the broken link / 404 page error when question marks are used in the title?

I have followed everything from this thread, and the one before it, reading through almost 22 pages of bug fixes, different code variations etc. But I don't think anyone has solved this one yet. :sad:

0

Hi,

Does anyone have a solution for the broken link / 404 page error when question marks are used in the title?

I have followed everything from this thread, and the one before it, reading through almost 22 pages of bug fixes, different code variations etc. But I don't think anyone has solved this one yet. :sad:

This post addresses the question marks in thread titles. There is still a problem with forum titles that use question marks, and for now, I've simply avoided using them.

0

What problems? it seems to work for me. It strips the question mark from the url. I'm more interested in the mod for the rest of the pages. Right now only the first page is search engine friendly but when you click page 2, 3 and so forth it back to .php

0

Anyone figure out a way to use this while using multiple styles? Using the dropdown selector ignores any attempt to change your style.

0

Anyone figure out a way to use this while using multiple styles? Using the dropdown selector ignores any attempt to change your style.

You don't really need to make this work with multiple styles, just your default style.. Remember the purpose of this mod is so that search engine spiders will index the keyword-rich URLs this mod generates. Since spiders won't index your site with multiple styles, you only need to apply this to whatever your default style is.

0

Sorry for a newbie question but I would like to replace the showthread.html? links at the bottom of each page (previous and next thread links) with title based keyword links.

I've modified the mod_rewrite hack to format thread links with both $threadID and $pagenumber as t#p# like this:

t125p4-my-thread-title.html

For which I modified my .htaccess line like so:

RewriteRule ^t([0-9]+)p([0-9]+)-(.*).html$ showthread.html?t=$1&page=$2 [L]

It rewrites just fine -- but now I need to find a way to modify the SHOWTHREAD template where the "previous" and "next thread" links are found in code like this:

<div class="smallfont" align="center">
	<strong>&laquo;</strong>  
		<a href="showthread.html?$session[sessionurl]t=$threadid&amp;goto=nextoldest">$vbphrase[prev_thread]</a>
		|
		<a href="showthread.html?$session[sessionurl]t=$threadid&amp;goto=nextnewest">$vbphrase[next_thread]</a>
	<strong>&raquo;</strong>
</div>

It seems like this should be pretty easy since we have access to the $threadID and $pagenumber variables -- and the URL part will be the same for all pages in the thread.

However, I cannot seem to access $thread. I'm too inexperienced with vBulletin and PHP to figure out what to try next.

Any suggestions appreciated.

- Chad

0

Aahh, my mistake. I don't want to modify the "Previous/Next Thread" links. I want to modify the numbered page links from the PAGENAV template -- specifically the numbered links 1|2|3|4 etc. which are built from the pagenav_pagelink template here:

<td class="alt1"><a href="$address&amp;page=$curpage$address2" class="smallfont"
 title="<phrase 1="$pagenumbers[first]" ="$pagenumbers[last]"
 3="$total" rel="nofollow">$vbphrase[show_results_x_to_y_of_z</phrase>">$curpage</a></td>

Now, it seems this is built by the function construct_page_nav in function.php so I first simplified the pagenav_pagelink template (above) to read:

<td class="alt1"><a href="$tpURL.html" class="smallfont" 
title="$threadTitle, page $curpage">$curpage</a></td>

And then added a section into the beginning of function construct_page_nav (at the beginning of the while ($curpage++ < $totalpages) loop) like this:

// TEST MOD by Chad 
     global $threadid; 
     $threadTitle = 'My Test Thread Title';
     $threadURL = 'my-test-thread-title';
     $tpURL = 't'.$threadid.'p'.$curpage.'-'.$threadURL;
// END MOD

This results in a nicely formatted link:

t25p2-my-test-thread-title.html

So now how do I go about getting the REAL thread title and URL into the above code?

- Chad

0

Problem solved. I just added keith's mod_rewrite_title function to functions.php then replaced my TEST MOD in the construct_page_nav function with:

// MOD by Chad (4/16/05) ************
 global $threadid, $threadinfo; 
 $threadTitle = $threadinfo['title'];
 $tpURL = 't'.$threadid.'p'.$curpage.'-'.mod_rewrite_title($threadTitle);
// END MOD **************************

Works like a charm and now I have keyword links to all pages.

- Chad

0

Nice that you got it to work although I'm lost. If you have time, please post the instructions like Keith did. thanks!

0

Hey guys,

Just to let you know I've achieved this efficiently solely with one template edit. The thing that put me off installing this mod in the first place was the file edits as I'm trying not to modify my source at all. I'll be writing an article on it soon and publishing it :)

Regards,
- Dean

0

So has anybody posted a revised version of this mod_rewrite hack (Keith's version) with all the fixes in it so that it works with vb 3.0.7?

0

I did. Dani, please delete this post if inappropriate.

##############################################################
## MOD Title: Revised vBulletin 3.X Mod-Rewrite
## MOD Authors: Dani, KeithMcL, Ted S
## Contributor: agiacosa http://www.aquaticplantcentral.com
## MOD Description: make your vBulletin forum search engine spiderable - for Google and all the others
## MOD Version: 1.0.0
##
## Installation Level:    moderate
## Installation Time:     20 Minutes
## Files To Edit (5):     showthread.php
##                        forumdisplay.php
##                        search.php
##                        includes/functions_forumlist.php
##                        includes/functions_online.php
##
## Templates To Edit (8): forumhome_forumbit_level1_nopost
##                        forumhome_forumbit_level1_post
##                        forumhome_forumbit_level2_nopost
##                        forumhome_forumbit_level2_post
##                        forumhome_subforumbit_nopost
##                        forumhome_subforumbit_post
##                        forumhome_lastpostby
##                        threadbit
##
## New Files (1):         .htaccess
##
##############################################################
## For Security Purposes, Please Check: http://www.daniweb.com/techtalkforums/thread17549.html
## for the latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your Forum.
##############################################################
## Author Notes:
##
## Requires: mod-rewrite - check with you host to make sure you have it enabled
##
##############################################################
## MOD History:
##
##   2005-04-01 - Version 1.0.0
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ CREATE .htaccess file and upload to forum root directory]--
#
RewriteEngine on
Options +FollowSymLinks
RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?t=$1 [L]
RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]
#
#-----[ OPEN ]------------------------------------------
#
forumdisplay.php
#
#-----[ FIND ]------------------------------------------
#
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"];
$navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
}
#
#-----[ REPLACE WITH ]----------------------------------
#
// ################ MOD_REWRITE HACK ######################
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"];
$forumURL = strtolower(str_replace(" ", "-",str_replace("/", "-", $forumTitle)));
$navbits["f$forumID-$forumURL.html"] = $forumTitle;
}
// ################ MOD_REWRITE HACK ######################
#
#-----[ FIND ]------------------------------------------
#
$thread = process_thread_array($thread, $lastread, $foruminfo);
#
#-----[ AFTER, ADD ]------------------------------------
#
// ################ MOD_REWRITE HACK ######################
$thread = strtolower(str_replace(" ", "-", $thread));
$thread = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $thread);
// ################ MOD_REWRITE HACK ######################
#
#-----[ OPEN ]------------------------------------------
#
showthread.php
#
#-----[ FIND ]------------------------------------------
#
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"];
$navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
}
#
#-----[ REPLACE WITH ]----------------------------------
#
// ################ MOD_REWRITE HACK ######################
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"];
$forumURL = strtolower(str_replace(" ", "-",str_replace("/", "-", $forumTitle)));
$navbits["f$forumID-$forumURL.html"] = $forumTitle;
}
// ################ MOD_REWRITE HACK ######################
#
#-----[ OPEN ]------------------------------------------
#
search.php
#
#-----[ FIND ]------------------------------------------
#
$thread = process_thread_array($thread, $lastread["$thread[forumid]"]);
#
#-----[ AFTER, ADD ]------------------------------------
#
// ################ MOD_REWRITE HACK ######################
$thread = strtolower(str_replace(" ", "-", $thread));
$thread = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $thread);
// ################ MOD_REWRITE HACK ######################
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_formlist.php
#
#-----[ FIND ]------------------------------------------
#
// do light bulb
$forum = fetch_forum_lightbulb($forumid, $lastpostinfo, $forum);
#
#-----[ BEFORE, ADD ]-----------------------------------
#
// ################ MOD_REWRITE HACK ######################
$forum = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum)));
$forum = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $forum);
// ################ MOD_REWRITE HACK ######################
#
#-----[ FIND THIRD INSTANCE OF]-------------------------
#
$forumperms = $bbuserinfo["$forumid"];
#
#-----[ BEFORE, ADD ]-----------------------------------
#
// ################ MOD_REWRITE HACK ######################
$forum = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum)));
$forum = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $forum);
// ################ MOD_REWRITE HACK ######################
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_online.php
#
#-----[ FIND ]------------------------------------------
#
// ###################### Start showonline #######################
#
#-----[ BEFORE, ADD ]-----------------------------------
#
// ###################### MOD_REWRITE HACK #################
function mod_rewrite_title($title)
{
$rewritten = strtolower(str_replace(" ", "-",str_replace("/", "-", $title)));
return ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $rewritten);
}
// ###################### MOD_REWRITE HACK #################
#
#-----[ FIND ALL INSTANCES]-----------------------------
#
<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>
#
#-----[ REPLACE ALL WITH ]------------------------------
#
<a href=\"t$threadid-" .mod_rewrite_title($threadtitle). ".html\" title=\"$threadpreview\">$threadtitle</a>
#
#-----[ FIND ALL INSTANCES]-----------------------------
#
<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>
#
#-----[ REPLACE ALL WITH ]------------------------------
#
<a href=\"f$forumid-" .mod_rewrite_title($forumtitle). ".html\">$forumtitle</a>
#
#-----[ FIND ]------------------------------------------
#
convert_short_varnames($values);
$userinfo = $values;
#
#-----[ AFTER, ADD ]------------------------------------
#
// #################### MOD_REWRITE HACK #################
if (eregi("t([0-9]+)-(.*).html$", $filename, $tmatch)) {
$filename = 'showthread.php';
$values = $tmatch[1];
}
if (eregi("f([0-9]+)-(.*).html$", $filename, $fmatch)) {
$filename = 'forumdisplay.php';
$values = $fmatch[1];
}
// #################### MOD_REWRITE HACK #################
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/FORUM HOME TEMPLATES/forumhome_forumbit_level1_nopost
#
#-----[ FIND ]------------------------------------------
#
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="f$forum[forumid]-$forum.html">
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/FORUM HOME TEMPLATES/forumhome_forumbit_level1_post
#
#-----[ FIND ]------------------------------------------
#
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="f$forum[forumid]-$forum.html">
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/FORUM HOME TEMPLATES/forumhome_forumbit_level2_nopost
#
#-----[ FIND ]------------------------------------------
#
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="f$forum[forumid]-$forum.html">
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/FORUM HOME TEMPLATES/forumhome_forumbit_level2_post
#
#-----[ FIND ]------------------------------------------
#
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="f$forum[forumid]-$forum.html">
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/FORUM HOME TEMPLATES/forumhome_subforumbit_nopost
#
#-----[ FIND ]------------------------------------------
#
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="f$forum[forumid]-$forum.html">
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/FORUM HOME TEMPLATES/forumhome_subforumbit_post
#
#-----[ FIND ]------------------------------------------
#
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="f$forum[forumid]-$forum.html">
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/FORUM HOME TEMPLATES/forumhome_lastpostby
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$lastpostinfo[lastthreadid]" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="newpostinthread$lastpostinfo[lastthreadid].html" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a>
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$lastpostinfo[lastthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="lastpostinthread$lastpostinfo[lastthreadid].html"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
#
#-----[ OPEN ]------------------------------------------
#
AdminCP/THREADBIT TEMPLATES/threadbit
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$thread[threadid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="lastpostinthread$thread[threadid].html">
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="newpostinthread$thread[threadid].html">
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="t$thread[threadid]-$thread

Edited by happygeek: fixed formatting

0

Just to let you know I've achieved this efficiently solely with one template edit. ... I'll be writing an article on it soon and publishing it :)

You're killing me Dean! At least give us a little to chew on!

- Chad

0

I did. Dani, please delete this post if inappropriate.

Thanks agiacosa!

So that version has all the major fixes posted in this thread? Wow, it's even in easy to read phpbb mod format. Thanks!

0

You're killing me Dean! At least give us a little to chew on!

- Chad

Well it's compatible with forumdisplay, showthread, showthread-pages and similar threads :) The only thing I'm having problems with is who-online. I'm trying to keep this to only one-templated you see. Everything is working apart from the who's online :D

I've done some benchmarks too as far as processing time goes and it's extremely efficient.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.