[Revised] vBulletin Mod_rewrite Tutorial

Reply

Join Date: Mar 2005
Posts: 17
Reputation: Tdot is an unknown quantity at this point 
Solved Threads: 0
Tdot Tdot is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #91
Apr 2nd, 2005
ok there... fellas.

I have used this site - http://tools.summitmedia.co.uk/spider/ to spidy my site.

My site is www.thalforum.com and when i put this to spider.. i get all broken links.

However when I put www.thalforum.com/forums in th spidy tool.. then i get all pages spidered in html

Q: what do i need to do in order to spider all my pages by entering www.thalforum.com since most spiders actually visit the main page first.

everything else is just fyne.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 18
Reputation: agiacosa is an unknown quantity at this point 
Solved Threads: 0
agiacosa agiacosa is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #92
Apr 3rd, 2005
Tdot,

I continue to think your .htaccess is wrong.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 17
Reputation: Tdot is an unknown quantity at this point 
Solved Threads: 0
Tdot Tdot is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #93
Apr 3rd, 2005
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.....
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 18
Reputation: agiacosa is an unknown quantity at this point 
Solved Threads: 0
agiacosa agiacosa is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #94
Apr 3rd, 2005
Remove goto=newpost&
Remove RewriteRule ^forum-one.html$ forumdisplay.php?f=1 [L]

Try it then.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 17
Reputation: Tdot is an unknown quantity at this point 
Solved Threads: 0
Tdot Tdot is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #95
Apr 4th, 2005
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 ..
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 18
Reputation: agiacosa is an unknown quantity at this point 
Solved Threads: 0
agiacosa agiacosa is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #96
Apr 4th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 5
Reputation: Raze is an unknown quantity at this point 
Solved Threads: 0
Raze Raze is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #97
Apr 4th, 2005
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['session_logged_in'] )
{
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['session_logged_in'] )
{
$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['session_logged_in'] )
{
if (stristr($url, 'http://')) {
header('Location: ' . $url);
exit;
}
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
wish someone would convert it to vB! :-(
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 18
Reputation: agiacosa is an unknown quantity at this point 
Solved Threads: 0
agiacosa agiacosa is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #98
Apr 5th, 2005
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[highlight]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="t$thread[threadid]-$thread[url].html">
#
#-----[ FIND ]------------------------------------------
#
<a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$thread[threadid]">
#
#-----[ REPLACE WITH ]----------------------------------
#
<a href="lastpostinthread$thread[threadid].html">
#
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 17
Reputation: Tdot is an unknown quantity at this point 
Solved Threads: 0
Tdot Tdot is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #99
Apr 6th, 2005
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="floatstylevar[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="floatstylevar[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="floatstylevar[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-alignstylevar[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.

|
......
Thalforum.com - Thalassemia Community Forums
http://www.thalforum.com/forums - Forums
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 18
Reputation: agiacosa is an unknown quantity at this point 
Solved Threads: 0
agiacosa agiacosa is offline Offline
Newbie Poster

Re: [Revised] vBulletin Mod_rewrite Tutorial

 
0
  #100
Apr 7th, 2005
Thank you. I have the same templates but the problems continue. :-(

Originally Posted by Tdot
Lastpostby Template


threadbit template.




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

sry for the deplayed response btw.

|
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC