Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 04-12-2016, 07:33 PM
CnfsdWhtGuy CnfsdWhtGuy is offline
 
Join Date: Jan 2016
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok so the next is...

http://www.killbillet.com/forum/rat-...nt-for-headers

Above is the incorrect link. Below is the correct link.

http://www.killbillet.com/showthread...+paint+headers

This one looks a bit harder... Any advice? Thanks thanks thanks!!!

--------------- Added [DATE]1460498265[/DATE] at [TIME]1460498265[/TIME] ---------------

Quote:
Originally Posted by Paul M View Post
There are no known security flaws in 4.2.3, so who exactly sent you this email?
When we upgraded in the first place it was from a previous version. Not 4.2.3. I didn't want to have to mess around with upgrading again in the near future. Thats why I made the transition to 5.x. The emails were sent from Vbulletin.
Reply With Quote
  #12  
Old 04-13-2016, 05:28 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just look at the URL structure and my previous rewriterule, you'll see that it's quite easy to make a rewriterule for that.

HTML Code:
RewriteRule ^forum/(.*)/(.*)/([0-9]+)-(.*)$ showthread.php?$3-$4 [R=301,L]
However, this will not work to URL's that are constructed differently.
It will only work to URL's which are constructed like: /forum/section-name/subsection-name/threadid-threadtitle

-

Also, you might want to include the following in your .htaccess file:
HTML Code:
RewriteBase /
The absolute path is currently used on your site which causes 404 errors.
Or just include a backslash in front of the URL's in the RewriteRules.
Reply With Quote
  #13  
Old 04-13-2016, 04:24 PM
CnfsdWhtGuy CnfsdWhtGuy is offline
 
Join Date: Jan 2016
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want to understand how this works so I am going to break this down. Hopefully you can confirm/help me understand.

Original redirect - RewriteRule ^member/([0-9]+)-(.*)$ member.php?$1-$2 [R=301,L]

New New redirect - RewriteRule ^forum/(.*)/(.*)/([0-9]+)-(.*)$ showthread.php?$3-$4 [R=301,L]

So the (.*) refers to any written title in a subfolder?

And the ([0-9]+) is any combination of numbers 0-9 in a link?

Does the $ signify the separation from the original link to the new? I almost think of it as the If x is this $(then) Y should be this?

Why is the first rule $1-$2 and the second is $3-$4?

And finally I am assuming this [R=301,L] is what is telling the server it is a redirect. correct?
Reply With Quote
  #14  
Old 04-13-2016, 04:29 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

RewriteRule ^forum/(.*)/(.*)/([0-9]+)-(.*)$ showthread.php?$3-$4 [R=301,L]

(.*) will match anything.
([0-9]+) will only match numbers of any length.

Whenever there's a match, it will be stored inside of a variable. In this case $3 will be the third match, which is the part which checks for the number. Each part that I made red will be stored in a variable.

The first URL only contains 2 different variables each time, so we only have to extract 2 variables.
The second URL contains 4 different things in the URL which may not be unique, that's why we simply match it with (.*).

RewriteRules and regexes are quite a pain.
Reply With Quote
  #15  
Old 04-13-2016, 04:47 PM
CnfsdWhtGuy CnfsdWhtGuy is offline
 
Join Date: Jan 2016
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perfect. Thanks for breaking it down for me. You are an awesome guy Dave. If there was a service that would allow me to buy you a beer and have it delivered I would. Just saying.

--------------- Added [DATE]1460573313[/DATE] at [TIME]1460573313[/TIME] ---------------

One last question on that last set of coding. That last variable varies between the two links. One has - and the other has +. Does that matter?

--------------- Added [DATE]1460573408[/DATE] at [TIME]1460573408[/TIME] ---------------

and can I just list these in the .htaccess file? Is there a way I have to separate them?
Reply With Quote
  #16  
Old 04-13-2016, 04:57 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem.

Not quite sure what you mean with your first question but regarding your second question, just place the rewriterules under each other and it should work fine.

For example:
HTML Code:
RewriteEngine On
RewriteBase /
RewriteRule ^member/([0-9]+)-(.*)$ member.php?$1-$2 [R=301,L]
RewriteRule ^forum/(.*)/(.*)/([0-9]+)-(.*)$ showthread.php?$3-$4 [R=301,L]
Reply With Quote
Благодарность от:
TheLastSuperman
  #17  
Old 04-14-2016, 03:40 PM
CnfsdWhtGuy CnfsdWhtGuy is offline
 
Join Date: Jan 2016
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dave,

For the fist question. The $3 and $4 variables we are matching up from the links I sent. The first uses - or dashes to separate words whereas the other style uses the + or plus sign to separate the words. Does that matter at all? Or are they considered the same thing?
Reply With Quote
  #18  
Old 04-14-2016, 03:44 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A + being used to separate words is rather odd because a + is considered as a space.

Were you referring to this URL?
http://www.killbillet.com/showthread...+paint+headers

Because the last part is a "highlight" part, that parameter is not required in order for the link to work.
Reply With Quote
  #19  
Old 04-15-2016, 05:15 PM
CnfsdWhtGuy CnfsdWhtGuy is offline
 
Join Date: Jan 2016
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I uploaded your coding and it gave me a 404 error. This is what the link shows...

http://www.killbillet.com/home/killb...nt-for-headers

Did I do something wrong?
Reply With Quote
  #20  
Old 04-15-2016, 05:25 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you also add "RewriteBase /" after "RewriteEngine On"?
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 08:04 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.04087 seconds
  • Memory Usage 2,259KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete