nginx rewrite rules from Invision Cloud to Xenforo self hosted?

ekool

Well-known member
We are getting ready to a site away from Invision Cloud to a self hosted Xenforo installation. I'm wondering if anyone has any nginx rewrite rules for this?
 
For anyone else looking to do this, I got it working with the help of ChatGPT. Since the package is set up for .htaccess and not nginx, there is some conversion to do. It took ChatGPT a few iterations to get it working but this finally ended up working for me on most of the important URL's.

The code below will go above your normal location / { block.
Code:
    location = /gallery {
        return 301 https://www.sitename.com/media/;
    }

   location = /gallery/ {
        return 301 https://www.sitename.com/media/;
    }



    # Legacy IPS -> XenForo bridge handler
    # Match /topic/... OR /forums/topic/... only
    location ~ ^/(topic|forums?/topic|user|profile|gallery/(image|album|category))/ {
        rewrite ^ /ips2xf.php last;
    }

    # Handle query string show=topic|forum|user
    if ($arg_show ~* "^(topic|forum|user)$") {
        rewrite ^ /ips2xf.php last;
    }

    # 2. Skip rewrites for these system paths
    location ~ ^/(data|js|styles|install) {
        try_files $uri $uri/ =404;
    }

And utilizing this package after a normal IPB forum/gallery import: https://xenforo.com/community/resources/redirection-scripts-for-invision-ip-forums-and-gallery.5948/

Hope this helps someone else in the future.
 
Back
Top Bottom