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;
}