VBulletin SEO URL Rewriting

by Mark Marucot on August 19, 2007

  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

{ 1 comment… read it below or add one }

Hire Dedicated MySQL Programmer May 17, 2010 at 7:15 am

i came here from google and i found your information is so useful and very informative thanks for posting.

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: