Pagination mod rewrite help

Hi all can someone please help me out in trying to get clean URL for my pagination setup

here is the actual pagination code:



<?php
$Nav="";
If($page > 1) {

      }

For($i = 1 ; $i <= $NumberOfPages ; $i++) {
If($i == $page) {
$Nav .= "<B>$i</B>";

      }Else{

$Nav .= "<class='pagination'><A HREF=\\"results.php?page="   . $i . "&search=" .urlencode($search) . "\\">$i</A>";


     }
}

        If($page < $NumberOfPages) {

$Nav .= "<class='pagination'><A HREF=\\"results.php?page=" . ($page+1) . "&search=" .urlencode($search) . "\\">Next >></A>";

      }

Echo "<BR><BR>" . $Nav;
echo "</div>";
echo "</div>";
?>

 

This is how I would like my “current” pagination looks when I try to search

http://www.example.com/results.php?page=1&search=games

this is how I would like my URL to be

http://www.example.com/search_games_1.html

or similar

thanks

Sinz,

The FIRST step in creating mod_rewrite code is to be able to state (words) what you have in the “new format” URI and how that will be “translated” by mod_rewrite to the “old (serve-able) format.” When you do that, you should be able to see any potential pitfall (like other .html files which may be “translated,” too). Once you can “speak the spec,” creating the code becomes trivial.

Regards,

DK

What have you tried yourself? If nothing please read the following article to get a basic introduction to mod_rewrite: http://www.datakoncepts.com/seo

If you have any questions feel free to come back here to ask them :slight_smile: