Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vRewrite - SEOed URLs for vBulletin Details »»
vRewrite - SEOed URLs for vBulletin
Version: 1.5.1, by Immortal Immortal is offline
Developer Last Online: May 2010 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 01-04-2006 Last Update: 05-15-2006 Installs: 506
Uses Plugins Template Edits
Additional Files  
No support by the author.

About

vRewrite is an advance but simple system to rewrite vB's URLs. The rewrite system uses preg_match_all and str_replace to rewrite the URLs. It will rewrite any URLs that are dynamic ex: showthread.php?t= to /the-forum/title-of-the-forum-id.html. Why? SEs (Search Engines) rate results based on filename. Not only that, but most SEs give a "boost" to static URLs (what we do here) versus dynamic URLs. vRewrite accomplishes both of this, for all URLs that a search engine (or a guest) will see.

Installation

Please download vRewrite.zip and read install.html for more information on how to install it.

Requirements

vRewrite assumes that you are using Apache with the mod_rewrite module enabled, and running vBulletin 3.5.x. However, if you ask for support here on IIS' module or on vBulletin 3.0.x - I will be more then happy to assist you.

Contributions

I would like to thank Chroder and Cole for assisting me release vRewrite. I could not have released it if it wasn't for them.

I would like to thank the following people/boards for helping beta test vRewrite and making it a better product.

Gaming Ultimate, BP Gaming, NBS Designz Cyclez, Hosting-Talk and Forum University.

Copyright

I've spent many hours working and perfecting vRewrite. The only thing I ask you to do is if you use it, please keep the link back. If you wish to put it in your style instead, simply remove or comment out that line. However, if you use vRewrite you MUST link back. That is the only thing I ask.

Known Issues

There are no known issues with the latest release (1.0).

Support / Issues

If you have any problems or discover a bug please post here in this thread. I have also included my email in the install.html email for one-on-one support. The only thing I ask you is please do not post this email address publicly - it is my personal email.

Changelog

1.5 Release - vRewrite 1.5 has become stable, and all users under 1.5 RC3 and 1.0 need to upgrade. Support for 1.0 will no longer be offered, and you will be told simply to upgrade. Please continue to keep all bug and feature suggestions on the bug tracker at:

Code:
http://www.techhelpforum.com/vrewrite
1.1 Release - Several bug fixes, and a few new features. Details here.

03/26/06 - Updated the thread to reflect vRewrite 1.5 Beta links. vRewrite files has NOT changed.

03/11/06 - Updated the thread to take advantage of vB.org's new prefix feature. vRewrite itself has NOT changed.

1.0 Release (02/19/06) - I have released the much awaited 1.0. This is the first stable release of vRewrite. All users now should be safe installing vRewrite. For more information, and how to upgrade, please see here.

1.0 Preview (01/12/06) - I have released a preview version of 1.0. This is the final version before 1.0 is considered stable. I believe everything should work in this new preview, but one bug (see known issues). Please see here for more information and how to upgrade.

01/05/06 - Updated ZIP to include a fix for boards running a table prefix. You do not need to upgrade unless you previously had SQL errors. You can upgrade by importing the product and choose "Allow Overwrite".

Donations

Any donations are very much appreciated! I do this out of my free time and work many hours on it - all for free. Anything to help is always very welcomed

If you use vRewrite, please click Install. This helps you keep track of additional upgrades and shows to me that you care about vRewrite


You may not post vRewrite ZIP or any files contained in the ZIP on any website. You may not also post any support requests/give support on any website other then this one, without my permission. If you do so, you will get a DMCA for copyright infringement. I do not want this spread to pirated users. Please stop piracy and do not share the source outside of this thread and vB.org/com. Thanks.

Support will only be obtained at:
https://vborg.vbsupport.ru/forumdisplay.php?f=182

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #272  
Old 01-21-2006, 01:04 PM
rlamego rlamego is offline
 
Join Date: Nov 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Incorrect? Please! =) Incorrect is misleading other people with answers that don't relate to their questions while promoting a commercial product on the thread of a free alternative version.

If you really want to prove it can be done, although that wasn't the question of Smiry, and add some useful info while you're at it, you should have said:
"Not really. It can be done without the ID only if you use vBSEO which is a commercial product with encrypted source and costs a lot more than your vB license. Here's my URL to prove it."

This thread is about vRewrite and in that context and until further change, it is not possible to remove the id from that URL!
Reply With Quote
  #273  
Old 01-21-2006, 02:10 PM
Immortal Immortal is offline
 
Join Date: Jul 2005
Location: Cincinnati, OH
Posts: 403
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The way vRewrite currently handles all the URLs is done by ID searching. The way vBSEO is done (to my understanding as I've never used it) is done by one file which everything goes through. vRewrite 1.5 (if I ever get to it) is done by many entries in the mod_rewrite to handle all the rewrites, not done by one file. Which is why vBSEO can handle it without IDs, and vRewrite currently can't.
Reply With Quote
  #274  
Old 01-21-2006, 02:30 PM
Immortal Immortal is offline
 
Join Date: Jul 2005
Location: Cincinnati, OH
Posts: 403
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tutorial on custom rewrites/changing rewrtires

The first thing is first, back up all files!

The next thing you want to decide if you are doing a new rewrite or modifying an existing one. Either way, we will need to modify the .htaccess mod_rewrite rules. If you are modifying an already existing one, try and find which rule it is (it is pretty self-explanatory, the (.*) and $# represent variables in the rewrite). If you are creating a new one, copy off of one and use it as a template.

RewriteRule ^f-(.*)-(.*).html forumdisplay.php?f=$2 [L]

What this is telling us, is anything that starts with an f and then has two variables - separated by a hyphen applies to this rewrite. Since we don't care about the name of the forum, we only want the $2 aka the ID of the forum. Let's say we want it to be forumid.html. We will need to rewrite the rule to be:

RewriteRule ^forum(.*).html forumdisplay.php?f=$1 [L]

It really is that simple! Before we continue, you want to make sure you have the rule correct. Just go to yourforum.com/forum(some real id here).html. Does it work? If it does, then you did it correctly (and if you used that example) otherwise don't go on until you perfected that rewrite rule.

Now this is where the fun begins at. We will need to modify the plugin, but for member/showthread/forumdisplay there are an if statement to decide if we are on that. So if you are modifying any of these three, go to vB Options->vRewrite and choose the first rewrite option. We do not want the second!

Now go to ACP->Plugin Manager->vRewrite under global_complete. Edit it. This is where it gets messy so I would suggest playing with it on a test vB first, and then just copy and paste the code over. It's very easy to make a small mistake and cause a white page (aka a parse error).

Each rewrite rule is commented out like so:


#------------------------------
# Replace Forums
#------------------------------

But first we see
Code:
if($vbulletin->options['vRewrite_forumrewrite'] == "2") {
This is what I was talking about earlier. If you are using any of the 3 discussed above, skip down until you see the second one (in this case the second replace forums). There are only two for forumdisplay/showthread/member.

Here is what mine says now.

PHP Code:
#------------------------------
# Replace Forums
#------------------------------
$found preg_match_all('#<a href="forumdisplay\.php\?f=([0-9]+)"#i'$output$matches);

if(
$found)
{
    
// Build an array of ID's
    
$ids = array();

    for(
$i 0$i $found$i++)
    {
        
$fid $matches[1][$i];

        if(!
array_key_exists($fid$vbulletin->forumcache))
            continue;

        
$f $vbulletin->forumcache[$fid];
        
$fid $f['forumid'];
        
$title urlize($f['title']);

        
$output str_replace("<a href=\"forumdisplay.php?f=$fid\"""<a href=\"f-$title-$fid.html\""$output);
    }

Now we don't worry about anything besides the str_replace. The first part of the str_replace stays the same. However, the second part you see:

PHP Code:
"<a href=\"f-$title-$fid.html\"" 
Using our example from above, we would change this to:

PHP Code:
"<a href=\"forum$id\"" 
It really is that simple! You just got to be very careful when you upgrade vRewrite. Any questions, please keep 'em in the thread as I "technically" don't support this, but I may not notice
Reply With Quote
  #275  
Old 01-21-2006, 05:05 PM
rlamego rlamego is offline
 
Join Date: Nov 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the tutorial! =) Very nice!
Made my edits without any problem, except that the pull-down menus on vboptions still reflect the previous (default) values.
How can I change these?
Reply With Quote
  #276  
Old 01-21-2006, 05:49 PM
Immortal Immortal is offline
 
Join Date: Jul 2005
Location: Cincinnati, OH
Posts: 403
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You will need to turn your vB into debug mode, and then edit those settings. Or do I need step-by-step instructions? hehe
Reply With Quote
  #277  
Old 01-21-2006, 05:51 PM
rlamego rlamego is offline
 
Join Date: Nov 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A quick question, looking at the global_complete code, I see a lot of db queries that I assume are used to get some extra info not available on vb's forumcache like forum names, etc.
If we were going back to basics, using just the numeric ids, and having urls like: /f$id/, /t$id/, etc, would those queries still be needed?
Reply With Quote
  #278  
Old 01-21-2006, 05:59 PM
rlamego rlamego is offline
 
Join Date: Nov 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Immortal
You will need to turn your vB into debug mode, and then edit those settings. Or do I need step-by-step instructions? hehe
No thanks! =) Wicked! First time I turn on debug mode so never saw that before! Thanks again! =)
Reply With Quote
  #279  
Old 01-21-2006, 05:59 PM
Immortal Immortal is offline
 
Join Date: Jul 2005
Location: Cincinnati, OH
Posts: 403
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure don't
Reply With Quote
  #280  
Old 01-21-2006, 06:31 PM
rlamego rlamego is offline
 
Join Date: Nov 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't? Cool! Might seem odd but I'll try to mod it down to bare basics.
My host is sponsoring my site, charging me nothing for all that I use so I'm always extra careful not to waste their resources on unnecessary stuff!

Just to be sure I'm not making it worse, would you say that this is enough?
#------------------------------
# Replace User
#------------------------------
$found = preg_match_all('#member\.php\?u=([0-9]+)#i', $output, $matches);
if($found)
{
$output = str_replace("member.php?u=$uid", "member/$uid/", $output);
}
Reply With Quote
  #281  
Old 01-22-2006, 02:25 AM
Immortal Immortal is offline
 
Join Date: Jul 2005
Location: Cincinnati, OH
Posts: 403
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll need it put it in a while loop, I'll try and get you the code tomorrow.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:46 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12650 seconds
  • Memory Usage 2,338KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete