temporary fixed it with this code in function topic_generate_pagination($replies, $url) in includes/functions_display.php
- Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if (!empty($phpbb_seo->seo_opt['url_rewrite'])) {
error_log(var_export($pagination,1));
static $pagin_find = array();
static $pagin_replace = array();
if (empty($pagin_find)) {
$pagin_find = array(
// http://example.com/a_n-y/d.i.r/with.ext
'`(https?\://[a-z0-9_/\.-]+/[a-z0-9_\.-]+)(\.[a-z0-9]+)(\?[\w$%&~\-;:=,@+\. ]+)?(#[a-z0-9_\.-]+)?(&|\?)start=([0-9]+)`i',
// http://example.com/a_n-y/d.i.r/withoutext
'`(https?\://[a-z0-9_/\.-]+/[a-z0-9_-]+)/?(\?[\w$%&~\-;:=,@+\. ]+)?(#[a-z0-9_\.-]+)?(&|\?)start=([0-9]+)`i',
// try to fix [url=http://www.phpbb-seo.com/en/mixed-seo-url/article7184.html]404 error on page numbers[/url]
'`(https?\://[a-z0-9_/\.-]+)/?(.*)\.html(#[a-z0-9_\.-]+)?&start=([0-9]+)`i',
);
$pagin_replace = array(
// http://example.com/a_n-y/d.i.r/with-xx.ext
'\1' . $phpbb_seo->seo_delim['start'] . '\6\2\3\4',
// http://example.com/a_n-y/d.i.r/withoutext/pagexx.html
'\1/' . $phpbb_seo->seo_static['pagination'] . '\5' . $phpbb_seo->seo_ext['pagination'] . '\2\3',
// try to fix [url=http://www.phpbb-seo.com/en/mixed-seo-url/article7184.html]404 error on page numbers[/url]
'\1\2-\4.html\3',
);
}
// try to fix [url=http://www.phpbb-seo.com/en/mixed-seo-url/article7184.html]404 error on page numbers[/url]
//$pagination = preg_replace( $pagin_find, $pagin_replace, $pagination );
$count = 1;
while($count > 0) {
$pagination = preg_replace( $pagin_find, $pagin_replace, $pagination, -1, $count);
}
}
// www.phpBB-SEO.com SEO TOOLKIT END
added a 3rd replacement for $pagination and loop though all urls in html string $pagination
But the real cause seems to be
- that in viewforum the parameter added to the url is
&start=(number) instead of
?start=(number)
- preg_replace doesn't replace all occurances in $pagination, only the last one