Hello, I have a dating site, www.usmatch.info I created a line from htaccess file and it works when I type in directly on the browser, www.usmatch.info/1.html (orginial url is www.usmatch.info/index.php?pg=1) Here it is: RewriteRule ^([^/]*)\.html$ /index.php?pg=$1 [L] When I click on the 2nd or 3rd page, it goes back to normal urls like, /index.php?pg=2, /index.php?pg=3 I have links for the rest of dynamic pages to read as 1, 2, 3, 4, ...16 How do I change the code in PHP to move to next page with friendly pages like, www.usmatch.info/2.html, 3.html, .... here is the block of code: <? if($pages>1) { if ($pg!=1) { ?> <a href="<? echo $_SERVER['PHP_SELF'];?>?pg=<?php echo ($pg-1).$strpass; ?>" > <? } ?> Prev <? if ($pg!=1) { ?> </a> <?php } ?> <B> <? if ($pages>1) { ?> </B> <?php if ($pg<=15) { $jmpcnt=1; } else { $jmpcnt=$pg-15; } $cnt=0; while ( $jmpcnt<=$pages && ($cnt<=15) ) { $cnt++; if ($jmpcnt!=$pg) { ?> <a href="<? echo $_SERVER['PHP_SELF'];?>?pg=<?php echo "$jmpcnt$strpass"; ?>" > <? } else { echo "<b>"; } echo $jmpcnt; if ($jmpcnt!=$pg) { ?> </a> <?php }else{ echo "</b>"; } if ($jmpcnt<$pages) echo " "; ?> <?php $jmpcnt = $jmpcnt + 1; } ?> </font> <font class="normal"> <? } if ( $pg!=$pages && $pages<>0) { ?> <a href="<? echo $_SERVER['PHP_SELF'];?>?pg=<?php echo ($pg+1); ?><?php echo "$strpass"; ?>" > <? } ?> Next <? if ($pg!=$pages && $pages<>0) { ?> </a> <? } } ?> I already tried but it generated errors. Need your help. Thank you for reading this. Jenny.
Actually, you might want to check your HTACCESS file again because when I navigate to www.usmatch.info/index.php?pg=1 the URL is not rewritten.
You need to enter directory. www.usmatch.info/1.html That link should work. When I click on next page, it comes back to index.php?pg=2, how do I make it dynamic? When I click on 2nd page, the url should be /2.html thanks.
HTACCESS, if it were working correctly, would handle that automatically. The problem is in your HTACCESS. This may help you out: http://cooletips.de/htaccess/