VBulletin SEO URL Rewriting

August 19, 2007 · Print This Article

  1. Place the code below in the .htaccess.
    CODE:
    1. RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
    2. RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
    3. RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
    4. RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]

  2. Edit the functions_forumlist.phpSearch for:
    CODE:
    1. $forum['statusicon'] = fetch_forum_lightbulb($forumid, $lastpostinfo, $forum);

    and below that add

    CODE:
    1. $forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
    2. $forum['url'] = strtolower(str_replace("'", "",str_replace("/", "-", $forum['title'])));

  3. Edit the forumdisplay.php.Search for:
    CODE:
    1. $thread = process_thread_array($thread, $lastread, $foruminfo['allowicons']);

    and below that add

    CODE:
    1. $thread['url'] = strtolower(str_replace(" ", "-", $thread['threadtitle']));
    2. $thread['url'] = strtolower(str_replace("'", "", $thread['threadtitle']));
    3. $thread['url'] = ereg_replace("[/?!.$%£()~*@]+", "", $thread['url']);

  4. Edit the threadbit template.Search for:
    CODE:
    1. <a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">

    and below that add

    CODE:
    1. </a><a href="t$thread[threadid]-$thread[url].html">

  5. Change the following template:
    Search the following:

    CODE:
    1. </a><a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">

    Replace with:

    CODE:
    1. </a><a href="$forum[url].html">

    forumhome_forumbit_level1_nopost
    forumhome_forumbit_level1_post
    forumhome_forumbit_level2_nopost
    forumhome_forumbit_level2_post
    forumhome_lastpostby

Random Posts

Comments

One Response to “VBulletin SEO URL Rewriting”

  1. Dev Standards » Blog Archive » SEO URL Rewriting for GARS on August 19th, 2007 9:35 am

    [...] discussed the steps to setup the URL rewriting for VBulletin. For those forums using GARS, here are the [...]

Got something to say?