Jump to content


2 really simple mod rewrite questions

  • Please log in to reply
1 reply to this topic

#1 AdRock

  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 23 August 2006 - 12:07 AM

I have this rewrite rule which reads www.jackgodfrey.org.uk/news/1/2

RewriteRule ^([A-Za-z0-9]+)/([0-9]+)/([0-9]+)/?$ index.php?page=$1&limit=$2&pagenum=$3 [L]

How would I rewrite that to read www.jackgodfrey.org.uk/news/2 so it takes the /1/ out as that never changes.  It's only a limit to how many records are listed per page

The second question is this:

I have 4 pages names jack1, jack2, jack3 and jack4

How would i create a rule to read like this www.jackgodfrey.org.uk/jack/1 etc?
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#2 wildteen88

  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 23 August 2006 - 10:10 AM

Do you wantr to get rid of the limit parameter completly if so use this:
RewriteRule ^([A-Za-z0-9]+)/([0-9]+)/?$ index.php?page=$1&pagenum=$2 [L]

For your secound question, I'm not sure but prehaps this:
RewriteRule ^jack/([0-9]+)/$ jack$1.php
by file name you mean jackx.php, x being a number?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users