Forum Moderators: phranque
{
echo "<a href='meta-paginated.php?page=$i'>$i</a> ";
} RewriteRule ^(([^/]+/)*[^/.]+)$ index.php?page=$1 [L] [edited by: eelixduppy at 1:20 pm (utc) on Apr 25, 2012]
[edit reason] unlinked [/edit]
href="/mp4323" or href="/mp-4323" or similar for the link. The rule pattern then has to test for "mp-" and for "digits", capture the digits and rewrite to the named .php file passing ?page=$1 to it.
RewriteRule ^mp-([0-9]+)-(.+)?$ meta-paginated.php?page=$1 [L] [edited by: chrisguk at 9:57 am (utc) on Apr 25, 2012]
/product-45433 and /product-45433-acme-rotating-widget both return the same content. /product-45433-acme-rotating-widget and /product-45433-this-is-overpriced-junk both return the same content. (.+)? is for capturing optional text but the ^mp-([0-9]+)- part says that a hyphen is required after the page number. /p-2- or /p-2-something but you are requesting just /p-2 here. -(.+)? part can be discarded from your RewriteRule code. <a href='mp-$i'>$i</a>
<a href='mp-<?php print $i; ?>'><?php print $i; ?></a> <?php print '<a href=\'mp-' . $i . '\'>' . $i . '</a>';