User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,563 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,508 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 71631 | Replies: 238
Reply
Join Date: Oct 2004
Location: Dublin, Ireland
Posts: 32
Reputation: KeithMcL is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
KeithMcL KeithMcL is offline Offline
Light Poster

Re: vBulletin mod_rewrite

  #131  
Oct 16th, 2004
Hi,

For those of you having problems displaying sub-forums on your homepage here is the fix.

Open includes/functions_forumlist.php

Look for the line that reads (around line 527):
[php]$forum = $forumcache["$forumid"];[/php]And below that add
[php]// added by keith
$forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
// added by keith[/php]That should do it

If you have any problems let me know and I'll see what I can do.
Reply With Quote  
Join Date: Sep 2004
Posts: 7
Reputation: nkisberg2000 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
nkisberg2000 nkisberg2000 is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite

  #132  
Oct 16th, 2004
I used Cyber-SEO's little hack for the nav bar but have found a problem...

For some reason on page http://www.cardschat.com/t19-%5Bblog...-showdown.html

it only links to main-category.html not f1-main-category.html typa thing, any ideas?
Reply With Quote  
Join Date: Oct 2004
Location: Dublin, Ireland
Posts: 32
Reputation: KeithMcL is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
KeithMcL KeithMcL is offline Offline
Light Poster

Re: vBulletin mod_rewrite

  #133  
Oct 16th, 2004
Originally Posted by Natch
Now, search for every instance of [php]$userinfo['where'][/php]which refers to the three $filename instances above and alter the <a href="... statement to match the rewritten display of your URLs...

examples

[php]$userinfo['where'] = "<a href=\"f$forumid-" . mod_rewrite_title($forumtitle) . ".html\">$forumtitle</a>";

$userinfo['where'] = "<a href=\"t$threadid-" . mod_rewrite_title($threadtitle) . ".html\" title=\"$threadpreview\">$threadtitle</a>";

$userinfo['where'] = "<a href=\"post$postid.html#postid=$postid\" title=\"$threadpreview\">$threadtitle</a>";[/php]
There is a slight error in the code above.

Where it reads:
[php]$userinfo['where'] = "<a href=\"t$forumid-" . mod_rewrite_title($threadtitle) . ".html\" title=\"$threadpreview\">$threadtitle</a>";[/php]it should in fact read
[php]$userinfo['where'] = "<a href=\"t$threadid-" . mod_rewrite_title($threadtitle) . ".html\" title=\"$threadpreview\">$threadtitle</a>";[/php]
Last edited by cscgal : Oct 17th, 2004 at 11:23 pm.
Reply With Quote  
Join Date: Sep 2004
Posts: 7
Reputation: nkisberg2000 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
nkisberg2000 nkisberg2000 is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite

  #134  
Oct 17th, 2004
Basically, Using Cyber-SEO's code could someone make a way for navbar to work for Ted's/Keithmcl's method with the fX-keyword-keyword without mod-rewrite.
Reply With Quote  
Join Date: Oct 2004
Location: Townsville, Australia
Posts: 16
Reputation: Natch is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Natch Natch is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite

  #135  
Oct 17th, 2004
Originally Posted by KeithMcL
There is a slight error in the code above.

Where it reads:
[php]$userinfo['where'] = "<a href=\"t$forumid-" . mod_rewrite_title($threadtitle) . ".html\" title=\"$threadpreview\">$threadtitle</a>";[/php]it should in fact read
[php]$userinfo['where'] = "<a href=\"t$threadid-" . mod_rewrite_title($threadtitle) . ".html\" title=\"$threadpreview\">$threadtitle</a>";[/php]
Thanks KeithMcL: Dani - can you please edit my post to rectify my typo?
Natcher00 ... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
[vB.org] PNG24 transparency with IE * DaniWeb: mod_rewrite your vB
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,020
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 33
Solved Threads: 117
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: vBulletin mod_rewrite

  #136  
Oct 17th, 2004
Ok, Edited
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,020
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 33
Solved Threads: 117
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: vBulletin mod_rewrite

  #137  
Oct 21st, 2004
Just to let everyone know, Keith was generous enough to have rewritten this tutorial combining my hack as well as Ted's.

http://www.daniweb.com/tutorials/12725.html
Reply With Quote  
Join Date: Oct 2004
Posts: 1
Reputation: The Equivocate is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
The Equivocate The Equivocate is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite

  #138  
Oct 21st, 2004
I noticed that when you go to click on the latest post, the target url is "newpostinthread3.html" but when you click it, it links you to "showthread.php?p=3#post3" so did I do something wrong? Yet when you are viewing the forum and click on that thread, it shows "thread3.html"

And also, I want to fix the Online Location problem, but Natch's solution was too hard for me to figure out, so is there an easier way? Or one that goes into more detail so I can figure it out?
Reply With Quote  
Join Date: Oct 2004
Posts: 2
Reputation: achtungbaby is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
achtungbaby's Avatar
achtungbaby achtungbaby is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite

  #139  
Oct 23rd, 2004
Wow. Tremendous hack.

I have a dumb question though: I don't suppose you also have a handy-dandy redirect that will point my .html pages back to the .php ones, in the event that I'm not able to keep this hack up to date...? When I was using invisionboard a while back I'd used a hack similar to this one and it worked fine, but over time I wasn't able to keep all of the necessary edits going and soon abandoned. Unfortunately, I had spiders looking for .html pages for quite some time...
Reply With Quote  
Join Date: Oct 2004
Posts: 3
Reputation: fate is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
fate fate is offline Offline
Newbie Poster

Re: vBulletin mod_rewrite

  #140  
Oct 24th, 2004
hi. just for a test i put the following into the .htaccess file in the root dir of my forum:
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 ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]
RewriteRule ^post([0-9]+).html$ showthread.php?p=$1 [L]
but that made no difference whatsoever. no links changed anywhere. my hoster says that there is a workin mod_rewrite on the servers, but how come nothing works?

ps: my forum is on a subdomain.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:44 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC