vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Custom SEO urls (mod_rewrite only) (https://vborg.vbsupport.ru/showthread.php?t=231568)

3bir.com 03-04-2010 09:07 PM

Thank you Carnage

kristinprimal 03-30-2010 05:03 PM

This is working great for me up to a point, but what I'd really like now is a way to remove the forum number in the friendly URL.

i.e., right now it is showing:
http://mydomain.com/forums/forum/1234-the-forum-title

and I'd like it to just say:
http://mydomain.com/forums/forum/the-forum-title

Anyone know a way to do this? It doesn't have to be part of the product, if someone can tell me what .php file to change and where, and what to put in .htaccess, that would work for me too.

thanks very much~

Carnage 03-31-2010 02:56 PM

can't do that unfortunatly. Vb needs the number in order to identify which forum/thread is being accessed.

yellowpinky 04-03-2010 02:59 PM

Quote:

Originally Posted by Carnage- (Post 2013504)
can't do that unfortunatly. Vb needs the number in order to identify which forum/thread is being accessed.

There is a product vbSEO which changes the vb member url
from:
http://mydomain.com/members/1234-UserName

to:
http://mydomain.com/members/UserName

Getting rid of the user number.
There is underlying code already there to work without the number.
http://mydomain.com/member.php?username=UserName

What would be needed is a similar change to forum.php to process parameter
forumname=ForumName
Then comes the corner case that ForumName is not a unique key.

vbSEO handles this by moving the forumid to the other side of the slash.
from:
http://mydomain.com/forum/1234-the-forum-title

to:
http://mydomain.com/f1234/the-forum-title

yellowpinky 04-03-2010 03:19 PM

This is excellent stuff!

What/Where is necessary to change to enable..

from:
http://mydomain.com/album.php?u=1234

to:
http://mydomain.com/members/UserName/albums

Then from:
http://mydomain.com/album.php?albumid=345

to:
http://mydomain.com/members/UserName/albums/AlbumName

Finally from:
http://mydomain.com/album.php?albumi...tachmentid=456

to:
http://mydomain.com/members/UserName...56-PictureName

?

Carnage 04-04-2010 01:42 AM

The member one might be doable then, however you already identified the issue with doing the same for forum names and thread titles -> the titles are not unique.

As for moving the forumid to the other side of the slash, take a look at the code in the experimental zip i uploaded; there is at lease one example in there that shows how to do things like that. (your url would probably end up as forums/1234/forum-title thou; this can be changed but requires substantially more work)

album rewriting is not supported at all by vbulletin atm, I'm personally hoping that this is because they plan to give albums a major overhaul in 4.1 so didn't bother changing anything in 4.0

Fr4n-FX 05-03-2010 09:19 PM

i have a problem, when i write blog.xxxx.net this is the main forum, no blog.php

this is my htaccess:

Code:

RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}

RewriteCond %{HTTP_HOST} ^(www.)?forum.xxxx.net$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?blog.xxxx.net$ [NC]
RewriteRule ^/(index.php)?$ blog.php?%{QUERY_STRING}
RewriteRule ^/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
RewriteRule ^forums/(index.php)?$ forum.php?%{QUERY_STRING}
RewriteRule ^blogs/(index.php)?$ blog.php?%{QUERY_STRING}

any idea?


also i need to edit this:
http://www.vbulletin.com/forum/proje...?issueid=37477

in my template, for relative path url changes :/

Carnage 05-04-2010 12:11 PM

Just a brief look at your htaccess, i think its somewhat wrong. Try this instead:

Code:


RewriteCond %{HTTP_HOST} ^(www.)?forum.xxxx.net$ [NC]
RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}


RewriteCond %{HTTP_HOST} ^(www.)?blog.xxxx.net$ [NC]
RewriteRule ^/(index.php)?$ blog.php?%{QUERY_STRING}
RewriteRule ^/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
RewriteRule ^forums/(index.php)?$ forum.php?%{QUERY_STRING}
RewriteRule ^blogs/(index.php)?$ blog.php?%{QUERY_STRING}


frmessages 05-15-2010 11:09 AM

Hi there, thanks for this add-on which seems to solve some of the mess i had with the default URLs.

I keep getting one problem and maybe it could be solved by editing rewrites or something else along this mod ?

My Unregistered user is being redirected from http://www.example.com to http://www.example.com/content/

In fact the "Home section" leads to this /content/ whereas i would like it to be clean (root).

Which basically means i have no canonical URL to share.

The only place i can see i could edit is here but it says "leave them as are":

Code:

#these rules can't be edited by my mod, so leave them as are.
RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}
RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}

Or maybe there is something i should add to .htaccess at root ?

Any idea ? Thanks for your attention and keep up the good work :up:

Carnage 05-15-2010 01:29 PM

Unfortunatly, I've not yet figured out a clean way of editing the urls generated by the CMS; it seems to require a huge amount of editing of php files to get anywhere.

As for your other problem; I've got that set to work on my development board, but I don't remember how :s What are the values for the settings CMS url and default page under content management?


All times are GMT. The time now is 08:30 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04240 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete