OK, so I a n00b when it comes to regular expressions, so I am sure this problem is pretty simple.
So far I have a guestbook where I have:
index.php/guestbook/sign --> pages/guestbook.php?action=sign
index.php/guestbook/view --> pages/guestbook.php?action=view
But I also want people to be able to view a single entry by going to:
index.php/guestbook/view/23 --> pages/guestbook.php?action=view&id=23
So far the entry I have is:
RewriteRule ([^/\.]+)/([^/\.]+)/?$ /pages/$1.php?action=$2 [L]
I am having trouble adding the third variable in. I can simply repeat another ([^/\.]+) but this requires some entry to be there, so the first two links dont work anymore.
How can I set this up to that I can use the two vars or three in the situation I need to. I am aiming for a general case because I plan on adding other pages then the guestbook.