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)

WxP 01-27-2010 10:43 AM

1 Attachment(s)
I have trying /threads/ /threads threads/ Not working :(

Carnage 01-27-2010 03:01 PM

Code:

#Credits: Christopher Riley, Vbulletin, http://www.vbulletin.com/forum/showthread.php?325798
#File was made with the best bits from all the above.

#turn on and setup rewrite engine
RewriteEngine On
Options +FollowSymLinks

### THIS IS A LITTLE EXTRA SECURITY AND CAN BE REMOVED
#Has to be at the top else it wouldn't get past the accident prevention rules

RewriteRule ^includes/(.*) index.php
RewriteRule ^vb/(.*) index.php
RewriteRule ^packages/(.*) index.php

#Prevent rewriting files; this will/should stop accidentilly hiding images/js etc from the browser
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

#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}
RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
RewriteRule ^forums/index.php$ forum.php?%{QUERY_STRING}
#Place a # in front of the above rule and remove the # from the below rule if you want to make index.php optional in the url
#RewriteRule ^forums/(index.php)$ forum.php?%{QUERY_STRING}
RewriteRule ^members/([0-9]+) member.php?t=$1&%{QUERY_STRING}
RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
#You can remove the # in front of one of these rules to rewrite blogs/ or blogs/index.php to blogs.php
#(sorry i've no way to automatically detect If you are likely to need this or not)
#RewriteRule ^blogs/(index.php)$ forum.php?%{QUERY_STRING}
#RewriteRule ^blogs/index.php$ forum.php?%{QUERY_STRING}

Thats what I get out of the rewrites script when using the same settings as you have.

Bear in mind, you need to SAVE the settings before the rewrite script will give you upto date results.

WxP 01-27-2010 05:29 PM

Thank you, All installet but addons dont have chans with my script!

Plugin is on you can check www.forumivirtual.com if it work!

Carnage 01-27-2010 07:13 PM

You need to have mod_rewrite urls switched on.

Hammertime 03-03-2010 10:38 AM

If I try to view forums as guest I get a 404 Not found error with the url being www.mydomain.com/forum/forumtitle. When I log in, I can get to forum as the url changes to www.mydomain.com/forum/forum/forumtitle

Any idea what is wrong?

Carnage 03-03-2010 11:37 AM

I think this is a known bug in vbulletin; thou I thought it had been fixed...

Edit: was correct see http://www.vbulletin.com/forum/proje...?issueid=35139

If you change the forums prefix to something other than forum eg f or forums, it should work correctly.

Hammertime 03-03-2010 11:56 AM

Quote:

Originally Posted by Carnage- (Post 1995976)
I think this is a known bug in vbulletin; thou I thought it had been fixed...

Edit: was correct see http://www.vbulletin.com/forum/proje...?issueid=35139

If you change the forums prefix to something other than forum eg f or forums, it should work correctly.

Thanks for quick reply mate. Yeah I changed the prefix to f and it's working.

Is there any way to have it domain.com/forum/title rather than domain.com/forum/f/2-title? Or even a way to just remove the forum id?

Carnage 03-03-2010 03:22 PM

You can't remove the forumid - vb needs that to know which forum to show :p As for removing the 'f/' Its doable, however the more you mess around with the internals of the rewriting the more issues arise from it.

I have a really nice bit of code that rewrites threads to be /forums/forum-title/subforum-title/thread-title-threadid as elegant as it was, it required lots of little adjustments here and there to have it work properly.

3bir.com 03-04-2010 01:24 PM

can i customize it like That

::thread::
http://v.3bir.com/1/
page 2
http://v.3bir.com/1-2/

::Forums::
http://v.3bir.com/f14/
page 2
http://v.3bir.com/f14-2/

::Members::
http://v.3bir.com/m1/

Carnage 03-04-2010 08:59 PM

This mod allows for simple customisations only; as it relies on vbulletins own rewriting classes. The more you try to customise, the more likely it is that you will have knock on effects else where.

Once vbulletin is a bit more stable and its unlikely that the url classes will change too much between versions, at that point i'll look into other things that can be achieved.


All times are GMT. The time now is 03:51 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.01310 seconds
  • Memory Usage 1,741KB
  • 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
  • (1)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