vBulletin mod_rewrite for vB 3.0.7

Reply

Join Date: Apr 2005
Posts: 16
Reputation: yakusasci is an unknown quantity at this point 
Solved Threads: 0
yakusasci yakusasci is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #21
May 1st, 2005
Pff how quick u are ! Perfect for announcement.php ! Thanks dani!
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16
Reputation: yakusasci is an unknown quantity at this point 
Solved Threads: 0
yakusasci yakusasci is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #22
May 1st, 2005
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 ?
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,057
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #23
May 1st, 2005
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.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 4
Reputation: PhoenixDown is an unknown quantity at this point 
Solved Threads: 0
PhoenixDown PhoenixDown is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #24
May 2nd, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,057
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #25
May 2nd, 2005
I think a good way to work the archive is the way that I did at http://www.daniweb.com/techtalkforum...117122-12.html
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16
Reputation: yakusasci is an unknown quantity at this point 
Solved Threads: 0
yakusasci yakusasci is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #26
May 2nd, 2005
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 !
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,057
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #27
May 2nd, 2005
This link would be in the postbit template - ensure it looks like the one posted in this tutorial.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 3
Reputation: projectpilot is an unknown quantity at this point 
Solved Threads: 0
projectpilot projectpilot is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #28
May 2nd, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16
Reputation: yakusasci is an unknown quantity at this point 
Solved Threads: 0
yakusasci yakusasci is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #29
May 2nd, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,057
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: vBulletin mod_rewrite for vB 3.0.7

 
0
  #30
May 2nd, 2005
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]
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
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 Existing Scripts Forum


Views: 30453 | Replies: 117
Thread Tools Search this Thread



Tag cloud for Existing Scripts
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC