Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
vBSEO-style friendly urls using vB_Friendly_Url mechanism Details »
vBSEO-style friendly urls using vB_Friendly_Url mechanism
Mod Version: 0.6, by alex.sk (Member) alex.sk is offline
Developer Last Online: Aug 2014 I like it Show Printable Version Email this Page

vB Version: 4.x.x Rating: (4 votes - 3.75 average) Installs: 25
Released: 21 Feb 2013 Last Update: 23 Feb 2013 Downloads: 347
Not Supported Uses Plugins Re-usable Code Translations  

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Adjust ^members/ to match your friendlyurl_memberdir if necessary.

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.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #31  
Old 02 Nov 2013, 23:57
dreamygirl dreamygirl is offline
 
Join Date: Jan 2007
Originally Posted by ShortBuss View Post
Sure nuff, adding a couple more lines to htaccess gets things rolling right along
You never got a parse error like the one I got above? Thanks.
Reply With Quote
  #32  
Old 04 Dec 2013, 00:40
schan schan is offline
 
Join Date: Sep 2013
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.

Last edited by schan; 04 Dec 2013 at 01:10. Reason: Improved details + more troubleshooting info
Reply With Quote
  #33  
Old 07 Dec 2013, 01:35
schan schan is offline
 
Join Date: Sep 2013
Re: Solved

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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Only do this if you can ensure that there are no forum name conflicts.
Reply With Quote
  #34  
Old 07 Dec 2013, 18:44
dreamygirl dreamygirl is offline
 
Join Date: Jan 2007
Originally Posted by schan View Post
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.
I wondered if you could shed light on my problem at all? It's unrelated but since you have familiarity with this mod and some coding knowledge. I posted about my problem at http://www.vbulletin.org/forum/showp...3&postcount=25

Another user was having a problem like mine too. http://www.vbulletin.org/forum/showp...3&postcount=22
Reply With Quote
  #35  
Old 17 Dec 2013, 02:15
schan schan is offline
 
Join Date: Sep 2013
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
Reply With Quote
  #36  
Old 17 Dec 2013, 02:41
schan schan is offline
 
Join Date: Sep 2013
Dreamygirl,

For troubleshooting purposes, what version of PHP are you running?

Thanks,
-S
Reply With Quote
  #37  
Old 17 Dec 2013, 04:07
dreamygirl dreamygirl is offline
 
Join Date: Jan 2007
Originally Posted by schan View Post
For troubleshooting purposes, what version of PHP are you running?
5.2.17 (There's a possibilty it was lower a few months ago.)
Reply With Quote
  #38  
Old 17 Dec 2013, 22:57
schan schan is offline
 
Join Date: Sep 2013
Dreamygirl,

I think I have the solution.

In the friendly Url Classes plugin, on line 26, the author uses an anonymous function (closure).


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Anonymous functions is a feature that was added in PHP 5.3, which means, servers running PHP 5.2.x would run into syntax issues - the exact issues that you and I are having.

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
Reply With Quote
  #39  
Old 18 Dec 2013, 01:06
dreamygirl dreamygirl is offline
 
Join Date: Jan 2007
Originally Posted by schan View Post
This plugin works fine on our test server, which is running PHP 5.3.3.
Thanks, I'll upgrade when I can. If I get an error on PHP 5.3 or up, my errors are probably from another installed mod.
Reply With Quote
  #40  
Old 18 Dec 2013, 03:32
zylstra zylstra is offline
 
Join Date: Aug 2004
Why not simply fix the code instead?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #41  
Old 24 Dec 2013, 02:13
zylstra zylstra is offline
 
Join Date: Aug 2004
Also, be aware that some of the differences between this mod and vBSEO are:
  1. In vBSEO attachments may appear to exist in the attachments/ folder, whereas Friendly URLs uses the stock reference.
  2. In vBSEO forums may appear as /[forum-name], whereas Friendly URLs showed /[forum-name] as an error (in my experience. Please check your forums with no trailing slash).
  3. Last post and first new post image links don't seem to work in Friendly URLs.
  4. vBSEO keeps casing of title, whereas Friendly URLs lowercases the entire title for use in the URL.

Above

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #42  
Old 24 Dec 2013, 18:54
dreamygirl dreamygirl is offline
 
Join Date: Jan 2007
Originally Posted by zylstra View Post
[LIST=1][*]Last post and first new post image links don't seem to work in Friendly URLs.
Thanks for your list. I would like to see code to make /[forum-name] work without trailing slash, should be easy?

And to fix the last post and first new post links? That is a bug?

What does your included code do - keep the casing in Friendly URLs?
Reply With Quote
  #43  
Old 25 Dec 2013, 01:32
zylstra zylstra is offline
 
Join Date: Aug 2004
Originally Posted by dreamygirl View Post
I would like to see code to make /[forum-name] work without trailing slash, should be easy?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can try the above, but it didn't work for me. Perhaps try it with [L] at the end instead of [R].
Originally Posted by dreamygirl View Post
And to fix the last post and first new post links? That is a bug?
I don't know about this one. I reverted to vBSEO so won't be troubleshooting this mod any further.
Originally Posted by dreamygirl View Post
What does your included code do - keep the casing in Friendly URLs?
No it's not about the casing. Now that you mention it I can't remember what it is for. It had something to do with a css file that was called relatively (as opposed to absolutely, and so was being looked for in the /[forum-name]/ directories), but that I didn't have the time to figure out how to fix it in the skin/templates.
Reply With Quote
  #44  
Old 27 Dec 2013, 14:26
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
what i do wrong i get this:

The requested URL /diy-do-yourself/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Reply With Quote
  #45  
Old 29 Dec 2013, 15:57
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
nobody?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 00:05.

Layout Options | Width: Wide Color: