DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   [Revised] vBulletin Mod_rewrite Tutorial (http://www.daniweb.com/forums/thread12725.html)

berlin Apr 9th, 2005 5:15 am
Re: [Revised] vBulletin Mod_rewrite Tutorial
 
Hi, there has been so many fixes for this tutorial. It's already confusing. is there one with all the fixes?

agiacosa Apr 9th, 2005 9:29 am
Re: [Revised] vBulletin Mod_rewrite Tutorial
 
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.

berlin Apr 9th, 2005 4:36 pm
Re: [Revised] vBulletin Mod_rewrite Tutorial
 
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.p...6&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.

azziedone Apr 13th, 2005 9:52 am
Re: [Revised] vBulletin Mod_rewrite Tutorial
 
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:

BigBlueBall Apr 13th, 2005 1:09 pm
Re: [Revised] vBulletin Mod_rewrite Tutorial
 
Quote:

Originally Posted by azziedone
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.

berlin Apr 13th, 2005 1:29 pm
Re: [Revised] vBulletin Mod_rewrite Tutorial
 
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

extremefitness Apr 14th, 2005 3:59 pm
Re: [Revised] vBulletin Mod_rewrite Tutorial
 
Anyone figure out a way to use this while using multiple styles? Using the dropdown selector ignores any attempt to change your style.

BigBlueBall Apr 15th, 2005 12:35 pm
Re: [Revised] vBulletin Mod_rewrite Tutorial
 
Quote:

Originally Posted by extremefitness
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.

notepad Apr 16th, 2005 2:57 am
How to get title urls into previous - next thread
 
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[url]. I'm too inexperienced with vBulletin and PHP to figure out what to try next.

Any suggestions appreciated.

- Chad

notepad Apr 16th, 2005 7:18 pm
Re: How to get title urls into previous - next thread
 
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


All times are GMT -4. The time now is 5:05 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC