You need a plugin that also hooks on the getLink filter and then modify the url before returning it to match the rewritten one.
zp_register_filter('getLink', 'modify_url'); function modify_url($link, $page) { if($page == "index.php") { // $link the is the url you need to modify to your rewrittten one } return $link; }
Very quick example offhand, not tested.
There are two problems (bugs) that need to be fixed. First, the template-functions.php function getPageNumURL() needs to be fixed to handle custom pages:
$pg = stripSuffix($_zp_gallery_page); if (array_key_exists($pg, $_zp_conf_vars['special_pages'])) { $pagination1 = preg_replace('~^_PAGE_/~', _PAGE_ . '/', $_zp_conf_vars['special_pages'][$pg]['rewrite']) . '/'; } else { $pagination1 = '/' . _PAGE_ . '/' . $pg . '/'; }
Then the galleryToken plugin needs to have added a rewrite rule for handling the page numbers:
$_zp_conf_vars['special_pages'][] = array('define' => false, 'rewrite' => '%GALLERY_PAGE%/([0-9]+)', 'rule' => '^%REWRITE%/*$ index.php?p=gallery&page=$1' . ' [L,QSA]');
thanks Malte and Stephen!
I made a pull request to fix a typo on the new getCustomGalleryIndexPage() function.
with that, it works fine for my needs.