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

XF 1.4 Another VB 3.8 (VBSEO) to XF 1.4 Nginx rewrite plea :)

ichpen

Well-known member
#1
OK guys,

Hoping someone has some insights into this.

Migrating a VB 3.8 forum to another server running XF 1.4.7. Pretty new to XF hence the plea :)

Would be most appreciative of any help on my rewrites.

The domain will remain the same, I'm running the new forum off a dedicated IP side by side (so can play around with it). Using Nginx on new server.


The old forum structure VB3.8 with VBSEO (it's sort of broken so can't access the XML URL files but structure looks standard):

Root:
http://www.oldforum.com/forums/

Forums:
http://www.oldforum.com/forums/news/
http://www.oldforum.com/forums/stuff/
http://www.oldforum.com/forums/...../

Forum Pages:
http://www.oldforum.com/forums/news/index2.html

Threads:
http://www.oldforum.com/forums/news/7189-anti-theft.html
http://www.oldforum.com/forums/news/6908-profile-picture.html


New Forum (XF 1.4):
Root:

http://www.newforum.com

Forum Root is /forums/ and Friendly SEOs enabled:

Forums:
http://www.newforum.com/forums/
http://www.newforum.com/forums/news.30/

Forum Pages:

http://www.newforum.com/forums/news/page-2

Threads:
http://www.newforum.com/threads/profile-picture.6908/
.....

I did a test migration/import and it looks like IDs were retained but placed on the tail end of the thread.

Also a side question, I plan to do a fresh migration (again) by clearing out users/nodes/etc. I'm assuming I can still retain old IDs?

Appreciate it.
 
Last edited:

ichpen

Well-known member
#2
I guess question is can this be achieved with rewrites only? Looks possible or should I go the VB php scripts route . Doesn't appear to be a clear guide for this for nginx.

@Jake Bunce who appears to be the resident expert here :)

This sort of works except can't get pages to rewrite correctly:


location /forums/news/ {
rewrite /forums/news/([\d]+)-(.+)\.html /threads/$2.$1/ permanent;
rewrite /forums/news/([\d]+)-(.+)(-\d)\.html /threads/$2.$1/page$3 permanent;
}
 
Last edited:

ichpen

Well-known member
#4
That first rule will match the page links as well. Try putting the page rule first.
Thanks Jake. Not an expert, just threw this together quickly. Yeah, in hindsight the first will cover me for pages also, it won't match the exact page but will at least give me the same thread which I think is good enough so I'll probably get rid of the second rule entirely.

Now just need to rewrite the parent forums, define a rule for every forum and it should be good enough without resorting to scripts and hopefully not too taxing on the server as we're not crawling through every location. Anything I'm missing?
 
Last edited:

Jake Bunce

XenForo moderator
Staff member
#5
Try this to cover all forum slugs:

Code:
        location ~* ^/forums/(news|anotherforum|andanother|another)/ {
                rewrite /forums/[^/]+/([\d]+)-(.+)\.html /threads/$2.$1/ permanent;
                rewrite /forums/[^/]+/([\d]+)-(.+)(-\d)\.html /threads/$2.$1/page$3 permanent;
        }
You just need to name them all in the first line.