Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Custom SEO urls (mod_rewrite only) Details »
Custom SEO urls (mod_rewrite only)
Mod Version: 4.0-0.1 a4, by Carnage (Coder) Carnage is offline
Developer Last Online: Sep 2014 I like it Show Printable Version Email this Page

vB Version: 4.0.0 Rating: (4 votes - 4.75 average) Installs: 42
Released: 29 Dec 2009 Last Update: 19 Jan 2010 Downloads: 406
Not Supported Template Edits Code Changes Additional Files Re-usable Code Is in Beta Stage  

What does this do?
This mod allows you to define the beginning part of all the friendly urls. Eventually, more of the url may be customizable but this should be enough to provide a nice structure to your site anyway. I have now released this as more of a mod to make it easier for the less technical admins.

What use is this to me?
I can see a couple of major uses here.
1. If you want to translate the friendly urls into your local language (so instead of having http://example.com/threads/123-Test-Thread/ you have http://example.com/[translation]/123-Test-thread)
2. You want a bit more structure to your links eg forum/threads, forum/posts, blogs/entries etc
3. You just don't like the defaults you've been stuck with and want to change to t,p,f,b and e

Installation
1. First step here, is to ensure that the default mod rewrite urls work for you. Upload the default .htaccess file from the do_not_upload folder to your forums and switch on mod rewrite friendly urls in the server settings and optimisations area of your control panel.
2.Browse around your forums and check that all the links still work. (If they don't you need to work with vb support and your host to get them working)
3. Upload the contents of the upload folder in the zip.
4. Import the product.
5. There is now a new option group in your admin cp; friendly url settings. Change these to your liking.
5a. There is also a link to the rewrite rule generator from the settings page; once you've got the settings to your liking, visit the link to generate a .htaccess file. Alternativly follow the instructions below to make your own.
6. Once you've made these changes, you need to edit your .htaccess file rewrite rules to reflect the changes you made. You need to replicate the change to this file that you've made to the options. you will see a set of:

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

You need to change the red bits to match your settings.

7. (Optional) Extra credit. Some people want the /forums/ to point to the forumindex page and /blogs/ to point to blog.php the following rewrite rules will take care of this. These should be added to the .htaccess file (don't overwrite any existing rules, these are new ones)


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

Finally do a search of your templates + phrases for occurrences of forum.php and blog.php and change them to forums/index.php and blogs/index.php (or forums/ and blogs/) respectively.

forums.domain.com and blogs.domain.com support
This is not quite as easy as the above and requires a file edit to achieve.
If you are using 4.0.1; you can skip the file edit part as it appears to work without.
1. Make a backup copy of includes/class_friendly_url.php
2. Around line 604 find:

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

Replace


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

with

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

3. In your apache config or appropriate server config file, set a serveralias for the subdomains you want to use (eg forums.domain.com) You may need to contact your host for help with this step.
4. In the vbulletin control panel set the cookie domain to be .yourdomain.com
I dont know if this will have any knock on effects elsewhere, but it seems to be working for me on my dev board.
5. You can now set a value for forums to be http://forums.domain.com and blogs to be http://blogs.domain.com or similar based upon your requirement.
6. Rewrite rules are a bit more complex for this setup; this is a good resource for getting the server side stuff setup: http://www.reconn.us/content/view/46/67/

example rewrite rules:


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

Changelog
  • 4.0-0.1 a4
    • Added file to generate rewrite rules
    • Removed old instructions from this post to prevent confusion.
  • 4.0-0.1 a3
    • Fixed missing settings in product file.
  • 4.0-0.1 a2
    • Released as product
  • 4.0-0.1 a1
    • Initial release

Notes
  • forums.domain.com and blogs.domain.com is possible, but requires a file edit; Instructions above)
  • adding extra information to urls is /not/ currently possible (eg tags, forum name to threads etc)
  • if you want a custom url format, post what you would like and if its possible, I can give you more pointers on how to implement it.
  • if you change your url format, you may want to leave the old rewrite rules in making a copy of them instead of editing them.
  • if you want the old instructions, for manual file edits (advanced users only) pm me.
  • There is some experimental code now attached, this provides an example of how to create custom uri formats (includes forum name in thread urls) but is no where near finished and is for advanced users (read coders) only. This functionality will be built into the product once its been tested and is more stable.

Download Now

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

Screenshots

Click image for larger version

Name:	customurls.jpg
Views:	1375
Size:	89.7 KB
ID:	111102  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 29 Dec 2009, 16:11
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Tagged for future use.
Reply With Quote
  #3  
Old 29 Dec 2009, 17:21
BSMedia BSMedia is offline
 
Join Date: Feb 2009
This seems to be more of an article

But useful information none the less!
Reply With Quote
  #4  
Old 29 Dec 2009, 17:29
Zaiaku's Avatar
Zaiaku Zaiaku is offline
 
Join Date: Jul 2007
Originally Posted by BSMedia View Post
This seems to be more of an article

But useful information none the less!
I kind of have to agree with it. At first that's what I thought this was.
__________________
Live everyday as if it was your last, because one day it just may be.
Reply With Quote
  #5  
Old 29 Dec 2009, 18:08
rtyagis rtyagis is offline
 
Join Date: Feb 2009
Good Mod. Waiting for live demo.
__________________
PolicyWala | Forum
Reply With Quote
  #6  
Old 29 Dec 2009, 18:19
Carnage Carnage is offline
 
Join Date: Jan 2005
Originally Posted by BSMedia View Post
This seems to be more of an article

But useful information none the less!
Right now it is it may become a mod when the options are settable from the admin cp: I looked at how to do this with hooks/plugins and its a mess... I came up with a better way which requires file edits; but they are so trivial I submitted them as a patch to vb. Once I get feedback on the chances of getting the patch included in 4.0.x I'll know if its worth developing this into a full mod.
__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.
Reply With Quote
  #7  
Old 29 Dec 2009, 18:58
Ryan Ashbrook's Avatar
Ryan Ashbrook Ryan Ashbrook is offline
 
Join Date: Dec 2002
Tagged.
__________________
Ryan Ashbrook
Reply With Quote
  #8  
Old 29 Dec 2009, 19:24
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Do you plan to add forums.domain.com in the future? I would be extremely happy if you do.
Reply With Quote
  #9  
Old 29 Dec 2009, 23:35
Carnage Carnage is offline
 
Join Date: Jan 2005
I'm not sure if its possible; however I have an idea how it might be possible to get it to work.

Edit:
Tested my idea; it is at least in theory possible to have forums.example.com; if you set the path to http://forums.yourdomain.com/threads (for threads) the urls will be correct; but i've not idea how to get the rewrites working for it...
__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.

Last edited by Carnage; 29 Dec 2009 at 23:46.
Reply With Quote
  #10  
Old 30 Dec 2009, 00:05
jj's Avatar
jj jj is offline
 
Join Date: Sep 2005
Real name: Jens
I see this as an article, too. Nevertheless it's tagged for future use
Reply With Quote
  #11  
Old 30 Dec 2009, 02:11
Carnage Carnage is offline
 
Join Date: Jan 2005
ok; it is doable, however theres an aditional edit that needs to be made around line 604 find:

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

Replace


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

with

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

I dont know if this will have any knock on effects elsewhere, but it seems to be working for me on my dev board. You'll need to set a server alias for forums.yourdomain.com to be the same as yourdomain.com in apache and you'll also need to edit the cookie path domain to cover your entire domain (eg set it to .yourdomain.com). Once you've done this, if you set threads to http://forums.yourdomain.com/threads and forums to http://forums.yourdomain.com with a bit of tweaking, you should be able to get it right.
__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.

Last edited by Carnage; 30 Dec 2009 at 02:24.
Reply With Quote
  #12  
Old 06 Jan 2010, 17:17
Carnage Carnage is offline
 
Join Date: Jan 2005
I've updated the first post with a product and uploadable file which will allow customisations from the admincp (without requiring file edits to vbulletin php files)
__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.
Reply With Quote
  #13  
Old 06 Jan 2010, 17:53
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Great work looks easy and just waiting on the bugs to be worked out.
Reply With Quote
  #14  
Old 07 Jan 2010, 13:05
Carnage Carnage is offline
 
Join Date: Jan 2005
You could always assist with that process by installing it in a development enviroment and seeing if you can find some bugs :P
__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.
Reply With Quote
  #15  
Old 07 Jan 2010, 14:12
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Oops re-read and the default mod rewrite won't work as I get the 500 errors right now.
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 15:22.

Layout Options | Width: Wide Color: