XF 1.2 SMF redirect to xF

Skylined

Well-known member
Could somebody please help me to redirect from SMF to xF?

Sample

Code:
SMF - http://www.mtb.com.uy/foro/index.php?topic=5234.0
xF - http://www.mtb.com.uy/foro/temas/asiento-antiprostatico-%C2%BFes-necesario.5234/

Temas is spanish for threads. :)
 
Add to the top of the .htaccess file in the /foro directory:

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)topic=([0-9]+)\.
RewriteRule ^index\.php$ /foro/temas/%2/? [R=301,L]
 
Thank you @Jake Bunce, it worked! :)

There's one more that needs to be converted.
It's the same as above but with .html at the end.

Code:
http://www.mtb.com.uy/foro/index.php/topic,1014.0.html

Amendment to previous rules to include the new URL:

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)topic=([0-9]+)\.
RewriteRule ^index\.php$ /foro/temas/%2/? [R=301,L]

RewriteRule ^index\.php/topic,([0-9]+)\. /foro/temas/$1/ [R=301,L]
 
Found some more, this ones are linked to a specific post in a thread.

From
Code:
http://www.mtb.com.uy/foro/index.php/topic,2354.msg29258.html


To
Code:
http://www.mtb.com.uy/foro/temas/resultados-de-%E2%80%9Cgran-premio-orestes-carballo%E2%80%9D.2354/#post-29258
 
Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)topic=([0-9]+)\.
RewriteRule ^index\.php$ /foro/temas/%2/? [R=301,L]

RewriteRule ^index\.php/topic,([0-9]+)\. /foro/temas/$1/ [R=301,L]
RewriteRule ^index\.php/topic,([0-9]+)\.msg([0-9]+)\. /foro/posts/$2/ [R=301,L]

Amend with that and it should work.
 
Code:
RewriteRule ^index\.php/topic,([0-9]+)\. /foro/temas/$1/ [R=301,L]
RewriteRule ^index\.php/topic,([0-9]+)\.msg([0-9]+)\. /foro/posts/$2/ [R=301,L]
Flip the order around -- the "msg" one needs to go first as the general thread one matches both.
 
Uruguay is moving from second level domains to first level domains (.com.uy to just .uy).


I would like to change two things:
  1. Move from mtb.com.uy to just mtb.uy
  2. Move my forum from mtb.uy/foro to the root of mtb.uy

Could you guys please help me with this redirection?
 
@Skylined

That is all doable with one exception. When you move from /foro to / that will cause your current "foro" route to interfere with any redirects that we setup for the old /foro directory. Ideally you will need to change the name of your "foro" route to something else after the move, otherwise you won't be able to redirect traffic from /foro to /.
 
Uruguay is moving from second level domains to first level domains (.com.uy to just .uy).


I would like to change two things:
  1. Move from mtb.com.uy to just mtb.uy
  2. Move my forum from mtb.uy/foro to the root of mtb.uy

Could you guys please help me with this redirection?

Thanks @Jake Bunce. :)

So what would I have to do if I name the route as "foros"?

Move the XF files to your web root and update this setting:

Admin CP -> Home -> Options -> Basic Board Information -> Board URL

Delete the old /foro directory.

Add these rules to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

# enforce new domain, mtb.uy
RewriteCond %{HTTP_HOST} !^mtb\.uy$
RewriteRule ^(.*)$ http://mtb.uy/$1 [R=301,L]

# redirect old /foro directory to web root
RewriteRule ^foro/(.*)$ /$1 [R=301,L]
 
Top Bottom