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)

Skyrider 01-19-2010 12:29 PM

This is a really nice plugin, that's for sure.. But I have a small issue. As soon as I alter the links, the previous SEO URL will give a 404 / dead link. Anyway possible that the old SEO (For example, the RewriteRule ^forums/ can be "forward" to the new url without touching the whole link? So the whole link from:

www.xxx.com/forums/34-test to www.xxx.com/sections/34-test will merely forward forums to sections without touching the whole link together.

Second, is it also possible to get rid of the whole "forums"? so instead of:

www.xxx.com/forums/34-test

It will show:

www.xxx.com/34-test

Carnage 01-19-2010 01:34 PM

Quote:

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.
From the notes, i mentioned this. Essentially if you do that (and your old rules are compatible with the new ones) vb will redirect to the correct url.

For your second question; i've not tried every possible combination of rewrites; but that one should work.

BBF 01-19-2010 02:22 PM

Quote:

Originally Posted by Carnage- (Post 1960117)
That one isn't easilly possible, the id needs to be avaliable somewhere for vb to use to query the db with.

so just leave the id and add the name
domain.com/forums/10-off-topic

or something like this.

Brandon Sheley 01-19-2010 03:05 PM

will this work with a sitemap?
if not, than I don't find it useful ?

Carnage 01-19-2010 04:51 PM

Quote:

so just leave the id and add the name
domain.com/forums/10-off-topic
Thats the default setting without installing this mod. If you have your forums installed in forums however, setting the forums prefix to be blank will probably do this. (If you get a // in the url set it to http://www.domain.com/forums instead)

Quote:

will this work with a sitemap?
if not, than I don't find it useful ?
Ive not tested it with the site map; I assume that the sitemap uses the get_friendly_url() function thou, provided it does, then this will work with the sitemap.

WxP 01-23-2010 05:14 PM

i get this error:

No thread specified. If you followed a valid link, please notify the administrator

but link is in this mode:
/showthread.php?Prshndetje-dhe-Urime/KiSs-8111

Carnage 01-23-2010 06:09 PM

@WxP

1. It seems you are using the experimental code to create links. You need to create your own rewrite rules for this to work. It's also experimental if you can't get it working on your own, you will have to wait untill I've got the code more stable and included it in the main product.

2. You don't have the friendly urls set to mod_rewrite. This mod only works if you use that setting.

3. I'm guessing here but if you put the id right at the front of the url (eg before even the forum) it /might/ work as you've got it setup. eg:
/showthread.php?8111-Prshndetje-dhe-Urime/KiSs

Carnage 01-26-2010 10:25 AM

Added a screenshot of the options provided by this mod.

WxP 01-26-2010 10:54 PM

i do all this you can check!

i put this code in .htaccess

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 ^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}


Carnage 01-27-2010 09:32 AM

RewriteRule ^/threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}

should be

RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}

Thats either a bug in my script, or you put a / at the beggining of your threads setting


All times are GMT. The time now is 04:48 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.01257 seconds
  • Memory Usage 1,748KB
  • 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
  • (4)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