Pagination with custom page/mod

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators

Pagination with custom page/mod

Postby Mavicant » Fri Mar 13, 2009 11:17 pm

I really hope that this is the right place to post this. I have both the Advanced SEO mod installed, as well as the Zero duplicate one. I searched these forums for similar issues, and the closest thing I came up with was this: A Mods Pagination - Not Redirecting

However, it's only semi-applicable to me since I'm not modifying the memberlist, but rather a custom page.

Here's my custom page, minus all the sql stuff.

Code: Select all
<?php

define('IN_PHPBB', true);
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

/**
* Set some variables
*/
$start   = request_var('start', 0);
$number  = 15;

// sql stuff here

$db->sql_freeresult($result);

$template->assign_vars(array(
   'PAGINATION'          => generate_pagination(append_sid("{$phpbb_root_path}roster/index.$phpEx", ""), $total_results, $number, $start),
   'PAGE_NUMBER'         => on_page($total_results, $number, $start),
   'TOTAL_RESULTS'    => $total_results,
   )
);

page_header('Player Roster');

$template->set_filenames(array(
    'body' => 'player_roster.html',
));

page_footer();

?>


Now this works alright as the URLs in the pagination show up as -http://www.example.com/roster/index.php?start=15 etc.

However, whenever I try to alter the "generate_pagination" function, the URLs like to change to the extension pagexx.html, which of course aren't existing pages for my script. Is there an easy way to make it so that the URLs are something like:http://www.example.com/roster/15 or -http://www.example.com/roster/view15 and actually have the pagination function write them out correctly that way?

Thanks for your time. :)
Mavicant
 
Posts: 5
Joined: Wed Mar 11, 2009 7:47 am

Advertisement

Re: Pagination with custom page/mod

Postby dcz » Mon Mar 16, 2009 10:31 am

Why using example.com/roster/pagexx.html isn't an option ?

Cause if so, you'd just need to add an extra rewriterule to handle this extra case, something like :
Code: Select all
RewriteRule ^roster/(page([0-9]+)\.html)?$ roster/index.php?start=$2 [QSA,L,NC]


++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21393
Joined: Fri Apr 28, 2006 9:03 pm

Re: Pagination with custom page/mod

Postby Mavicant » Mon Mar 16, 2009 8:45 pm

Ahh, d'oh. I guess pagexx.html is an option. For some reason it just really hadn't crossed my mind.

I've got this thing all fixed now. Thank you. :)
Mavicant
 
Posts: 5
Joined: Wed Mar 11, 2009 7:47 am


Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: ADmantX [Bot] and 9 guests