• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Redirections vB 3.8 with vBseo

Luis

Well-known member
#1
I need a small help with the redirections for one importation. I need the rules to be inserted into the file .htaccess

The links are:

Old link vb http://www.my_domain.com/foro/index.php
New link xf http://www.my_domain.com/foro/

Old link vb http://www.my_domain.com/foro/todos.php
New link xf http://www.my_domain.com/foro/forums/

Old link vb http://www.my_domain.com/foro/normas-del-foro-158/
New link xf http://www.my_domain.com/foro/forums/normas-del-foro.158/

Old link vb http://www.my_domain.com/foro/normas-del-foro-158/normas-del-foro-mercado-aplicaci%F3n-11-03-2013-a-1271
New link xf http://www.my_domain.com/foro/threads/normas-del-foro-mercado-aplicacion-11-03-2013.1271/

Old link vb http://www.my_domain.com/foro/members/pistu-38/
New link xf http://www.my_domain.com/foro/members/pistu.38/

Old link vb http://www.my_domain.com/foro/members/list/
New link xf http://www.my_domain.com/foro/members/

Thank you for any help.

Regards, Luis.
 

Luis

Well-known member
#3
@Super120 Although my English is very bad, I understand that this is not necessary for us. We just need to rewrite rules to redirect the old URLs to the new URLs.

Regards, Luis.
 

Jake Bunce

XenForo moderator
Staff member
#5
Add these rules to the top of the .htaccess file in the /foro directory (which should be XF's .htaccess file):

Code:
RewriteEngine On

RewriteRule ^todos\.php$ forums/ [R=301,L]

RewriteRule ^[^/]+-([0-9]+)/$ forums/$1/ [R=301,L]

RewriteRule ^[^/]+/[^/]+-([0-9]+)$ threads/$1/ [R=301,L]

RewriteRule ^members/[^/]+-([0-9]+)/$ members/$1/ [R=301,L]

RewriteRule ^members/list/$ members/ [R=301,L]
 

Luis

Well-known member
#6
Hello,

@Jake Bunce thanks for the redirections. Today we have made the importation, we're testing rewrite rules, but do not work, any help is welcome.

Thanks and regards, Luis.
 

Jake Bunce

XenForo moderator
Staff member
#7
Hello,

@Jake Bunce thanks for the redirections. Today we have made the importation, we're testing rewrite rules, but do not work, any help is welcome.

Thanks and regards, Luis.
I need to see an example. What is one of the old thread URLs? And what is the corresponding new URL that is should redirect to?
 

Jake Bunce

XenForo moderator
Staff member
#9
Some of Google's thread links have ending slashes, so use this to allow for an ending slash:

Code:
RewriteEngine On

RewriteRule ^todos\.php$ forums/ [R=301,L]

RewriteRule ^[^/]+-([0-9]+)/$ forums/$1/ [R=301,L]

RewriteRule ^[^/]+/[^/]+-([0-9]+)/?$ threads/$1/ [R=301,L]

RewriteRule ^members/[^/]+-([0-9]+)/$ members/$1/ [R=301,L]

RewriteRule ^members/list/$ members/ [R=301,L]