943,813 Members | Top Members by Rank

Ad:
You are currently viewing page 3 of this multi-page discussion thread; Jump to the first page
May 1st, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

Pff how quick u are ! Perfect for announcement.php ! Thanks dani!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yakusasci is offline Offline
16 posts
since Apr 2005
May 1st, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

A quick idea : the top of the top of the top - because now it's the top of the top - would be for old indexed pages like showthread.php?t=23 ... to redirect to new urls with a 301 (moved permanently) header; is it possible ?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yakusasci is offline Offline
16 posts
since Apr 2005
May 1st, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

This is unfortunately not possible. Remember, behind the scenes, the .html pages are really just aliases for their php counterparts. If we do a 301 redirect on the php pages to redirect to the html pages, and then tell Apache that the html pages are aliases for the php pages, we're going to end up in an infinite loop, and no real page will ever be loaded.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
May 2nd, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

Hi Dani. This is a very wicked tutorial, it looks like it took a lot of time and energy to create so thank you for sharing it with the rest of us lowely peons.

I have a question for you though... I noticed that the archive already makes use of more search engine friendly urls and I currently have the spiders redirected there with the spiders file. I was wondering what your thoughts were about keeping the spiders to the archive versus letting them crawl a mod_rewritten friendly url? Thanks!

PS: I had a bonus question since your the guru! I was thinking of useing mod_rewrite or something similar to include the thread names in the archive's url. I understand there is a performance hit but I'm trying to gauge what the trade off might be. Thanks again.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
PhoenixDown is offline Offline
4 posts
since Apr 2005
May 2nd, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

I think a good way to work the archive is the way that I did at http://www.daniweb.com/techtalkforum...117122-12.html
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
May 2nd, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

Quote originally posted by cscgal ...
This is unfortunately not possible. Remember, behind the scenes, the .html pages are really just aliases for their php counterparts. If we do a 301 redirect on the php pages to redirect to the html pages, and then tell Apache that the html pages are aliases for the php pages, we're going to end up in an infinite loop, and no real page will ever be loaded.
ok tks dani; that's what I thought. I've got a problem with showpost : dynamic link : showpost.php?p=262630&postcount=11 something I forgot ? tks !
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yakusasci is offline Offline
16 posts
since Apr 2005
May 2nd, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

This link would be in the postbit template - ensure it looks like the one posted in this tutorial.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
May 2nd, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

Quote originally posted by cscgal ...
Answers to your questions:

(2) To make your archive work like a sitemap, where the links to the threads redirect to your *real* forum threads (mod_rewritten versions, of course!) then make the following two changes to your archive/index.php file. (Just as in the above tutorial, replace the first line with the second line)

[html]
echo "<p class=\"largefont\">$vbphrase[view_full_version] : <a href=\"$vboptions[bburl]/forumdisplay.php?f=$foruminfo[forumid]\">$foruminfo[title]</a></p>\n<hr />\n";
echo "<p class=\"largefont\">$vbphrase[view_full_version] : <a href=\"../../forum$foruminfo[forumid].html\">$foruminfo[title]</a></p>\n<hr />\n";

echo "\t<li><a href=\"" . (!SLASH_METHOD ? 'index.php?' : '') . "t-$thread[threadid].html\">$thread[title]</a>" . iif($pda, " <i>(" . construct_phrase($vbphrase['x_replies'], $thread['replycount']) . ")</i>") . "</li>\n";
echo "\t<li><a href=\"../../thread$thread[threadid].html\">$thread[title]</a>" . iif($pda, " <i>(" . construct_phrase($vbphrase['x_replies'], $thread['replycount']) . ")</i>") . "</li>\n";
[/html]

I tried these 2 line modification to my archive file. The index page would not even load. Is there anything need to be added in the .htaccess file also?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
projectpilot is offline Offline
3 posts
since May 2005
May 2nd, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

Quote originally posted by cscgal ...
This link would be in the postbit template - ensure it looks like the one posted in this tutorial.
ok it's perfect now. tks !

sorry but another problem : on online.php I get some

unknown place
/forum84-2-lastpost--25--1.html
unknown place
/post163310-3.html
unknown place
/thread13032-painter.html

for many lines it's ok.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yakusasci is offline Offline
16 posts
since Apr 2005
May 2nd, 2005
0

Re: vBulletin mod_rewrite for vB 3.0.7

By default, the hack only fixes the generic forum and thread URLs in Who's Online. It doesn't handle multiple pages or when search queries are used, etc. For a completely mod_rewritten Who's Online, make the following changes to the includes/functions_online.php file. In each instance, replace the commented out line (the line with the //) with the non-commented line that appears below it. The lines will appear in the same order within the file as noted below.

[php]
// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"thread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]p=$postid#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"threadedpost$postid.html#post$postid\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>";
$userinfo['where'] = "<a href=\"forum$forumid.html\">$forumtitle</a>";

// $userinfo['where'] = "<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>";
$userinfo['where'] = "<a href=\"forum$forumid.html\">$forumtitle</a>";

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"thread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]p=$postid#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"threadedpost$postid.html#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"$vboptions[forumhome].php?$session[sessionurl]\">$vboptions[bbtitle]</a>";
$userinfo['where'] = "<a href=\"\">$vboptions[bbtitle]</a>";

// $userinfo['where'] = "<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>";
$userinfo['where'] = "<a href=\"forum$forumid.html\">$forumtitle</a>";

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"thread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"thread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>";

// edited by dani
/* $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a><br />" .
"<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>"; */
$userinfo['where'] = "<a href=\"thread$threadid.html\" title=\"$threadpreview\">$threadtitle</a><br />" .
"<a href=\"forum$forumid.html\">$forumtitle</a>";

// $userinfo['where'] = "<a href=\"announcement.php?$session[sessionurl]f=$forumid\">$forumtitle</a>";
$userinfo['where'] = "<a href=\"announcement$forumid.html\">$forumtitle</a>";

// $userinfo['where'] = "<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>";
$userinfo['where'] = "<a href=\"forumd$forumid.html\">$forumtitle</a>";

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]p=$postid#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"threadedpost$postid.html#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"printthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"printthread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]p=$postid#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"threadedpost$postid.html#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"printthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"printthread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"thread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>"; }

// $userinfo['where'] = "<a href=\"showthread.php?$session[sessionurl]t=$threadid\" title=\"$threadpreview\">$threadtitle</a>";
$userinfo['where'] = "<a href=\"thread$threadid.html\" title=\"$threadpreview\">$threadtitle</a>";

// $userinfo['where'] = "<a href=\"$vboptions[forumhome].php?$session[sessionurl]\">$vboptions[bbtitle]</a>";
$userinfo['where'] = "<a href=\"\">$vboptions[bbtitle]</a>";

// $userinfo['where'] = "<a href=\"$vboptions[forumhome].php?$session[sessionurl]\">$vboptions[bbtitle]</a>";
$userinfo['where'] = "<a href=\"\">$vboptions[bbtitle]</a>";

// $userinfo['where'] = "<a href=\"$vboptions[forumhome].php?$session[sessionurl]\">$vboptions[bbtitle]</a>";
$userinfo['where'] = "<a href=\"\">$vboptions[bbtitle]</a>";

[/php]

And then, below[php] convert_short_varnames($values);
$userinfo['values'] = $values;[/php]add[php]
// added by dani for seo hack
if (eregi("forum([0-9]+)", $filename, $fmatch))
{
$filename = 'forumdisplay.php';
$values['forumid'] = $fmatch[1];
}
if (eregi("thread([0-9]+)", $filename, $tmatch))
{
$filename = 'showthread.php';
$values['threadid'] = $tmatch[1];
}
if (eregi("threadnav([0-9]+)-([0-9]+)", $filename, $tmatch))
{
$filename = 'showthread.php';
$values['threadid'] = $tmatch[1];
}
if (eregi("threadmode([0-9]+)-(.*).html$", $filename, $tmatch))
{
$filename = 'showthread.php';
$values['threadid'] = $tmatch[1];
}
if (eregi("post([0-9]+)", $filename, $pmatch))
{
$filename = 'showthread.php';
$values['postid'] = $pmatch[1];
}
if (eregi("posted([0-9]+).html$", $filename, $pmatch))
{
$filename = 'showthread.php';
$values['postid'] = $pmatch[1];
}
if (eregi("postmode([0-9]+)-(.*).html$", $filename, $pmatch))
{
$filename = 'showthread.php';
$values['postid'] = $pmatch[1];
}
// added by dani for seo hack
[/php]
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Configuring Readymade Scripts Forum Timeline: Seeking Text Editor for web pages
Next Thread in Configuring Readymade Scripts Forum Timeline: Error message: can I fix the problem?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC