vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Forum and Server Management (https://vborg.vbsupport.ru/forumdisplay.php?f=232)
-   -   htaccess rewrite issue (https://vborg.vbsupport.ru/showthread.php?t=307021)

RichieBoy67 01-17-2014 11:27 AM

Quote:

Originally Posted by ikopylov (Post 2474733)
For this part you can not
appeal
attention
?highlight=rules+standings
----------------------
vBseo remove this symbols^ "***"
these characters are not in the old *** link
Therefore, if the redirect server can not find their match
That's the only way how you can make a redirect :
Code:

Options +FollowSymLinks
RewriteEngine On

Redirect 301 /bodybuilding-discussion-news-226/official-mecca-top-6-guess-rules-standings-thread-2013-a-220802/index2.html http://musclemecca.com/threads/220802-***official-mecca-top-6-guess-rules-amp-standings-thread***-2013/page2
Redirect 301 /bodybuilding-discussion-news-226/official-mecca-top-6-guess-rules-standings-thread-2013-a-220802/index3.html http://musclemecca.com/threads/220802-***official-mecca-top-6-guess-rules-amp-standings-thread***-2013/page3
Redirect 301 /bodybuilding-discussion-news-226/official-mecca-top-6-guess-rules-standings-thread-2013-a-220802 http://musclemecca.com/threads/220802-***official-mecca-top-6-guess-rules-amp-standings-thread***-2013

These characters "***" and not enough
therefore, this is the only option as you can make a redirect

---------------------------

There is another option, but it's a bad idea to implement.

Code:

RedirectMatch 301 ^/([a-z-]+)-([0-9]+)/([a-z0-9-]+)-([0-9]+)$ http://musclemecca.com/threads/$4
That code must be placed in the bottom, a set of rules that apply to the triad

Execution sequence for example:
RedirectMatch old thread+post => new thread+post
RedirectMatch old thread+pool => new thread+pool
RedirectMatch old thread => new thread
RedirectMatch my bad kod => you bad thread ;)

Short link will be used:
http://musclemecca.com/threads/220802
This is good for the user, it gets to the desired page, but bad for search engine: it will be a duplicate page.

---------------------------
It's important:
Do not forget that Unix understands this:
Letter
letter

As two different words. In windows it as one word

This was messing me up big time! I was not aware of that.

Thanks! :)

RichieBoy67 01-20-2014 12:16 PM

Quick question related to this topic:

Here are some rules and some urls I am working on. Keep in mind I have 2 types of urls that need to be redirected as listed below.

PHP Code:

I successfully redirected
forum
-name/threadname-threadid/

using

RewriteRule 
[^/]+/[^/]+-([0-9]+)/ http://musclemecca.com/forums/showthread.php?t=$1 [L,R=301]

Is this correct and safeIt does work but I am unsure if it is totally correct.

##Next

I am trying to create a rule for

/
f226/new-bbing-movie-hits-theatres-may-30-a-191420/

which is 
something like forumid
/threadname-threadid/

I have written  

RewriteRule 
^f([0-9]+)/$ forumdisplay.php?f=$[L,R=301]

This is only redirecting to forum display like

forumdisplay
.php/226-MuscleMecca-HeadQuarters?t=210661

and not to the correct post 

Last question - How do I deal with thread titles that contain strange characters like ********** ??

Thanks for the help. I have learned alot from this thread.

ikopylov 01-20-2014 08:49 PM

through such construction: RewriteRule [^/]+/[^/]+-([0-9]+)/
will be held and processed all requests
images, smilies, links, all...

I do not understand why to create this url?

This is a very slow speed to open all site pages
vBulletin 4its very slow, why it make more slow?

I am testing with pinddom.tools:
1mb page without redirects download 4-5sec
1mb page with several redirects download 7-8sec

Search engines perfectly understand short url: showthread.php?t=123456

Redirects should be used only in emergencies

RichieBoy67 01-20-2014 08:56 PM

Thanks friend. I agree but this is an emergency. We have over 30,000 not found urls in Google and almost 2,000 server errors caused by broken urls.

I am just trying to get some of those not found urls pointing to the right place again.

I agree though that the rule I used was not wise. That is why I am here. :) To learn from the best and htaccess is my weakest point.

ikopylov 01-20-2014 09:04 PM

Apparently I do not understand you very well
Nevertheless previous post has the right to life

Write me an old and a new link
I'll write you a redirect rule

RichieBoy67 01-20-2014 09:38 PM

I agree.

I am having a problem with urls like this

PHP Code:

http://musclemecca.com/members/74229-tkD

to

http
://musclemecca.com/member.php/74229-tkD 

Thanks mate!

ikopylov 01-21-2014 05:51 AM

Create new folder musclemecca.com/member/
Add this .htaccess to new folder member

Code:

Options +FollowSymLinks
RewriteEngine On
RedirectMatch 301 ^/members/([0-9]+)-([A-Za-z0-9-]+)$ http://musclemecca.com/member.php/$1-$2

If not work:
Stop all RewriteRule(s) in root and check again.
Friend, I wrote to you several times: do not use RewriteRules use RedirectMatch

RichieBoy67 01-21-2014 07:17 AM

Thanks,

Ok this works. I forgot I already had the wrong htaccess in a members directory. This works. Starting to finally cut down on the error messages. Much appreciated! I am removing rewrite rules for redirect matches too.

I think I am finally starting to pick up on your method here. It is not what most do but it seems faster and better in my opinion. Great work on using this.

Am I on the right track here with this?

PHP Code:

Options +FollowSymLinks
RewriteEngine On
RedirectMatch 301 
^/mecca-bodybuilding-discussion-news-226/([A-Za-z0-9-]+)-([0-9-]+)$ http://musclemecca.com/showthread.php/$1-$2


This is to redirect urls like this that were under f226 but now under /mecca-bodybuilding-discussion-news-226 but are now displayed as http://musclemecca.com/showthread.php like below:

http://musclemecca.com/mecca-bodybuilding-discussion-news-226/art-atwood-dead-37-years-old-219676/

too

http
://musclemecca.com/showthread.php/219676-Art-Atwood-dead-at-37-years-old 


ikopylov 01-21-2014 03:02 PM

Quote:

Originally Posted by RichieBoy67 (Post 2475746)
Thanks,

Ok this works. I forgot I already had the wrong htaccess in a members directory. This works. Starting to finally cut down on the error messages. Much appreciated! I am removing rewrite rules for redirect matches too.

I think I am finally starting to pick up on your method here. It is not what most do but it seems faster and better in my opinion. Great work on using this.

Am I on the right track here with this?

PHP Code:

Options +FollowSymLinks
RewriteEngine On
RedirectMatch 301 
^/mecca-bodybuilding-discussion-news-226/([A-Za-z0-9-]+)-([0-9-]+)$ http://musclemecca.com/showthread.php/$1-$2


This is to redirect urls like this that were under f226 but now under /mecca-bodybuilding-discussion-news-226 but are now displayed as http://musclemecca.com/showthread.php like below:

http://musclemecca.com/mecca-bodybuilding-discussion-news-226/art-atwood-dead-37-years-old-219676/

too

http
://musclemecca.com/showthread.php/219676-Art-Atwood-dead-at-37-years-old 



Code:

RedirectMatch 301 ^/([A-Za-z0-9-]+)-([0-9]+)/([A-Za-z0-9-]+)-([0-9]+)/$ http://musclemecca.com/showthread.php/$4-$3

RichieBoy67 01-21-2014 04:25 PM

Thanks Ikopylov, I was way off but I am almost there. I understand the rules somewhat but certain things still confuse me.

One last question and I will not ask for anything else. You have already helped me correct thousands of not found urls. Thank you.

The only thing I really need to finish now is some urls that use the following

PHP Code:

http://musclemecca.com/f226/mr-olympia-2013-updates-info-thread-232742/

to another forum in the advanced friendly format

http
://musclemecca.com/showthread.php/232742-***Mr-Olympia-2013***-Updates-and-info-thread! 

Can you write one for me so I can figure out the rest?

Will I have to create directories for each of these like"f226"??

Thanks again! I think this should do it,
Rich


All times are GMT. The time now is 08:46 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.02040 seconds
  • Memory Usage 1,772KB
  • 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
  • (4)bbcode_code_printable
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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