How To Redirect IPS 4.x urls to XenForo 2 with htaccess

158 Views Asked by At

my old urls is example.com/topic/123456789-my-title-here/

and my new url is: example.com/threads/my-title-here.123456789/

how i can redirect old url to new url with htaccess

note: how i can split only numbers from old url, can use this address for new urls : example.com/threads/123456789/

i using xenforo 2

1

There are 1 best solutions below

0
mammadir On

i resolve the problem with this code:

RewriteRule ^forum/(\d+)-(.+)/page-(\d+)$ /forums/$2.$1/page-$3? [R=301,NC,L]
RewriteRule ^forum/(\d+)-(.+)/$ /forums/$2.$1/? [R=301,NC,L]
RewriteRule ^topic/(\d+)-(.+)/page-(\d+)$ /threads/$2.$1/page-$3? [R=301,NC,L]
RewriteRule ^topic/(\d+)-(.+)/$ /threads/$2.$1/? [R=301,NC,L]
RewriteRule ^user/(\d+)-(.+)/$ /members/$2.$1/? [R=301,NC,L]

add this codes below RewriteEngine On on .htaccess file