![]() |
vBSEO-style friendly urls using vB_Friendly_Url mechanism
1 Attachment(s)
This plugin enables the following url scheme:
vbulletin/forum-name/ vbulletin/forum-name/index10.html vbulletin/forum-name/thread-title-145.html vbulletin/forum-name/thread-title-145-7.html vbulletin/members/admin.html This is close to what vBSEO 3.5.2 generates in its default configuration. he original goal of this plugin was to allow ditching vBSEO during vB3-vB4 upgrade without suffering a massive link rot. At this moment, this plugin may be used as a starting point to implement some specific link scheme, but it's hardly useful by itself unless you have that particual vBSEO version; vBSEO 3.6.0 uses different link scheme not compatible with this one. The plugin hooks to the built-in url generation/parsing mechanism of vB4, overriding vB_Friendly_Url_* classes, unlike vBSEO which does whole-page preg replacements even in vB4. It works within the normal vB data flow, so it's small, simple, and quite fast. It's also very likely to play well along with other plugins like Cerberus. The links generated by this plugin do not always match those of vBSEO. There are slight differences in handling non-alphanumeric characters, and probably other issues too. However, it should accept all vBSEO thread links, in the worst case (CANON_STRICT) issuing some 301 redirects. Most of vBSEO configuration options are not supported. In particular, link structure is hard-coded. If you need something unusual, you may use this as a template, but you'll need to tweak it to get urls you want. Blog urls are not implemented; the site I wrote this for does not use vB blogs. Calendar urls and anything else not handled by vB_Friendly_Url is not supported. Configuration resides on the standard Friendly Urls page. The plugin can work in modes other than FRIENDLY_URL_REWRITE. It's not really indented to do it, it's more of a fallback option, but it's implemented. In FRIENDLY_URL_ADVANCED mode urls look like this: vbulletin/forumdisplay.php/forum-name.html vbulletin/forumdisplay.php/forum-name-10.html vbulletin/showthread.php/thread-title-145.html vbulletin/showthread.php/thread-title-145-7.html vbulletin/member.php/admin.html The plugin allows custom forum slugs, i.e. replacing forum-name with something else without changing the forum title. It's not pretty, but it works. Sample .htaccess rules for FRIENDLY_URL_REWRITE: Code:
RewriteBase /url/path/to/vbulletin Tested on vB 4.0.3 PL8 and vB 4.2.0. Should work on most 4.x.x versions. Feel free to post bug reports, suggestions etc. in this thread. |
i will try thx
|
Ok so what about us who are already using the vbulletin friendly url htaccess rewrite (minus vbseo). Does it handle redirecting traffic to the proper urls as well?
Also are there any changes to be made to the htaccess to achieve the urls above? PHP Code:
|
Unfortunately there's something wrong with this plugin. This immediately appears when enabled. Disappears with plugin disabled. Also this only appears on forum.php
The other pages like threads, forums & member pages were rewritten though. Quote:
|
If you are going to install this, I highly recommend not doing so on a populate forum, perform it on a test site. Google is the main source for traffic for many forum owners, so please keep in mind that braking your urls will drop your SERPS like its hot.
|
All the more reason to await this guy's response. :)
|
what is the point of buying vbseo after vb4 ? !
|
Ok, first of all:
DO NOT CHANGE URL STRUCTURE ON A LIVE BOARD if you care about your Google rankings. I didn't expect any questions in this direction, so I didn't even mention it in the first post. Use a test board. Plan your moves and have redirects ready for your old urls if you decide to move. Quote:
Same as installing vBSEO on a live board, atop of existing vB4 urls. It's a change in url structure. Currently the board with this plugin activated will not recognize standard vB4 urls (forums/ID-name, thread/ID-name etc) and will not redirect them to resp. forum/thread-ID.html urls. I can be done, btw, I just didn't even think of it. Quote:
Same as with standard vB4 urls. final kaoss, which vB version do you use? That looks really bad, but the only runtime-created function in the plugin is used in array_map(..., preg_split(...)), I wonder what could go wrong there. In any case, I guess I'll try it one something more recent than my 4.0.3 in a day or two, some maybe there will be updates from my side. Quote:
For me, it's about moving from vB3+vBSEO to vB4 while keeping the links intact. An alternative to this plugin being vB4+vBSEO, which, I totally agree, makes little sense. |
I am using vb 420 PL2. Waiting for 421 and just skip PL3 altogether.
|
Quote:
|
It is planned yes.
|
Quote:
VBSEO offers more then just SE friendly URL's - it has about 85 functions that can increase your rankings, URL rewrites is just one. I think this is a great mod idea for 3.8.7 vbseo users to vb 4.2 without vbseo - If it works, I hope it does for users. Best of luck |
Version 0.6 uploaded. Standard vB4 style urls are now accepted, FRIENDLY_URL_BASIC mode fixed
Note you'll need two more RewriteRules for the old urls to work. final kaoss: works well for me in vB 4.2.0. Check what you've got on line 466 of your init_startup. Quote:
My impression from the code is that it's 50% url rewrites, 30% general housekeeping (admincp, db, caches etc), 10% for template tweaks (title, meta etc) and the remaining 10% for stuff I have no idea about. |
Are you talking about your plugin's init_startup or vbulletins init_statup.php file? Because afaik both of those are vanilla, aka untouched.
|
I have a strong impression part of this thread is missing.
I meant init_startup hook from datastore. I.e. the piece of eval()'d code where line 466 happens to be. Unless you have better ideas, something like Code:
if($_GET['dumpinitstartup']) var_dump(vBulletinHook::fetch_hook('init_startup')); Code:
($hook = vBulletinHook::fetch_hook('init_startup')) ? eval($hook) : false; Quote:
In any case, with errors like this, I'd try to avoid any guesswork and make sure it's clear where exactly it happens. |
Also, a note: this plugin was written for vBSEO 3.5.2.
I didn't realize it but even 3.6.0 uses different link scheme in its default configuration. |
No idea, it decided to dump it all into one line doing it that way.
PHP Code:
|
please fix
|
Really though the only issue that I could find with it is that it enables the forum.php page to not render. The rest (forumdisplay, showthreads) works.
|
....found the problem....
|
mind sharing?
|
Our owner installed this, and now we are getting this:
Quote:
Any ideas? |
Sir i got 404 error :( please help
|
on which page did you receive 404?
|
Any help is appreciated. I am on 4.2.0 PL3. Upon installing, it gives an error. The error starts with
PHP Code:
|
Might be a long shot but try this php checker.
http://phpcodechecker.com/ |
...................
|
To disable the plugin/hook system open your config.php which can be found in your forumroot/includes directory
Just below Code:
<?php Code:
define('DISABLE_HOOKS', true); Then you can get into your ACP and disable the mod. Then enable the plugin/hook system again, either remove the line again or simply comment that line out. To do so, add two forward slashes " / " so it will look like Code:
// define('DISABLE_HOOKS', true); you simply have to remove those two " / ". |
Just installed this mod, so far so good. Adding a line for content.php helped as I'm running the suite.
Code:
RewriteRule ^content/(.*) content.php [L] Gone Fishing Forum Thanks a ton for this mod! With vbseo on the outs I was wondering how I was going to get the tidy urls I wanted. |
Sure nuff, adding a couple more lines to htaccess gets things rolling right along
Code:
RewriteRule ^blog/(.*) blog.php [L] |
Quote:
|
Thank you for this awesome plugin. I noticed that after installing this plugin, it takes a lot longer to go back to the home page on my site. I understand that there is a very small performance hit, but it shouldn't take more than 5 seconds longer to load the homepage. In addition, the site does an ajax request and that request takes about 10 seconds to complete. Without the plugin, it completes almost instantly when page loads.
I simply installed your plugin, and modified the .htaccess file with your sample .htaccess code. The only thing different is that I took out the RewriteBase line. In addition, I added in three extra lines for security: RewriteRule ^includes/(.*) index.php RewriteRule ^vb/(.*) index.php RewriteRule ^packages/(.*) index.php Does this shed any clue as to why my site hit a decrease in performance? Thank you in advance. |
The issue that I was having was that it took a long time to load up the home page. After troubleshooting, it was apparent that the algorithm to test for forum conflict names was causing a delay. I'm posting this as my solution just in case it helps anyone down the road.
If you have a huge forum, are experiencing slow page load, and have confirmed that you have no forum name conflicts, then remove this piece of code from the friendly url classes file. Code:
else foreach($this->registry->forumcache as $fid => $finfo) |
Quote:
Another user was having a problem like mine too. https://vborg.vbsupport.ru/showpost....3&postcount=22 |
Hey dreamygirl,
Sorry, I just came across your question for help in this thread. I am actually running into the same issue right now on a different server. I'm looking into it and will post back with a resolution once I figure it out. Hang in there! -S |
Dreamygirl,
For troubleshooting purposes, what version of PHP are you running? Thanks, -S |
Quote:
|
Dreamygirl,
I think I have the solution. In the friendly Url Classes plugin, on line 26, the author uses an anonymous function (closure). Code:
$stopwords = trim(implode('|', array_map( I would advise you to test the plugin on a test server running PHP 5.3 to see if it solves your problem. If so, you may want to look into upgrading the current server from PHP 5.2.x to PHP 5.3 provided that it doesn't break anything else. If it does, then you will need to modify the code in the plugin to be 5.2 compatible. This plugin works fine on our test server, which is running PHP 5.3.3. I'm almost certain this is the case, but I encourage that you test it for yourself before taking my word for it. I hope this helps. -S |
Quote:
|
Why not simply fix the code instead?
Code:
$pregquote_chars = array_fill(0, |
All times are GMT. The time now is 05:33 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|