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

Reply
 
Thread Tools
vBSEO-style friendly urls using vB_Friendly_Url mechanism Details »»
vBSEO-style friendly urls using vB_Friendly_Url mechanism
Version: 0.6, by alex.sk alex.sk is offline
Developer Last Online: Aug 2014 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.x.x Rating:
Released: 02-20-2013 Last Update: 02-22-2013 Installs: 26
Uses Plugins
Re-useable Code Translations  
No support by the author.

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

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Use these two only if you have friendlyurl_acceptvb4 enabled
RewriteRule ^threads/(.*) showthread.php [L]
RewriteRule ^forums/(.*) forumdisplay.php [L]

RewriteRule ^members/([^/]+).html$ member.php [L]
RewriteRule ^[^/]+/index\d*.html$ forumdisplay.php [L]
RewriteRule ^[^/]+/[^/]+.html$ showthread.php [L]
RewriteRule ^[^/]+/?$ forumdisplay.php [L]
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

File Type: xml product-fti-friendly-urls.xml (30.4 KB, 367 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
sodasusu, tbworld

Comments
  #42  
Old 12-24-2013, 02:13 AM
zylstra zylstra is offline
 
Join Date: Aug 2004
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Code:
RewriteRule ^members/([^/]+).html$ member.php [L]
Add
Code:
RewriteRule ^[^/]+/clientscript/(.+)$ clientscript/$1 [L]
Reply With Quote
  #43  
Old 12-24-2013, 06:54 PM
dreamygirl dreamygirl is offline
 
Join Date: Jan 2007
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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
  #44  
Old 12-25-2013, 01:32 AM
zylstra zylstra is offline
 
Join Date: Aug 2004
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dreamygirl View Post
I would like to see code to make /[forum-name] work without trailing slash, should be easy?
Code:
# Add / to the end of virtual directories.  This resulted in URLs like /home/[user]/public_html/[forum-name]/ , which isn't what you want.
RewriteRule   ^([^/.]+[^/])$       $1/  [R]
You can try the above, but it didn't work for me. Perhaps try it with [L] at the end instead of [R].
Quote:
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.
Quote:
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
  #45  
Old 12-27-2013, 02:26 PM
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #46  
Old 12-29-2013, 03:57 PM
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nobody?
Reply With Quote
  #47  
Old 01-06-2014, 06:42 PM
psychonikeo psychonikeo is offline
 
Join Date: Nov 2009
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, i really hope you can help us out.

We were running VB3+vBSEO where all links were rewritten as follows:

Code:
www.baseurl.com/forum/subforum_name/ID-name_of_topic.html
Now we went live and we can't get the URL's to get in that format again in vb4. Will your plugin help with that?
Reply With Quote
  #48  
Old 01-07-2014, 05:22 PM
josegmfid josegmfid is offline
 
Join Date: Jun 2012
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

How to remove ".html" ?

I like this:

vbulletin/forum-name/
vbulletin/forum-name/index10
vbulletin/forum-name/thread-title-145
vbulletin/forum-name/thread-title-145/7
vbulletin/members/admin
Reply With Quote
  #49  
Old 01-13-2014, 02:46 AM
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

its work nice for me!

thx
Reply With Quote
  #50  
Old 01-17-2014, 11:21 AM
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just have a problem .. When I turn on a topic then I automatically directed to the first page, even though I have responded so then I hear my reaction to be conducted if I click on the topic I have posted and not to the first article .. what now?
Reply With Quote
  #51  
Old 01-19-2014, 04:24 AM
Ladillaxx Ladillaxx is offline
 
Join Date: Mar 2009
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need help.
I need to change this
Quote:
minecraft-noticias/%E2%BFqui%E3%A9n-fue-el-creador-de-minecraft-4.html
by this.

Quote:
minecraft-noticias/?Qui?n-fue-el-creador-de-Minecraft?-4.html
Please someone tells me I should change?
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 02:22 AM.


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.06151 seconds
  • Memory Usage 2,340KB
  • 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
  • (5)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete