Add sub-dir support for pagination