I have been through the various tutorials on this site and just cant seem to find the answer, so i was wondering if anyone could help me add a second variable to a mod rewrite. I know how to add one, but the second one i just cant seem to get. Heres what i have:
RewriteRule ^forums/newtopic/([0-9]+).*$ forums/newtopic.php?id=$1
but i need it to make this url (www.site.com/forums/newtopic.php?id=ID&action=process)
into (www.site.com/forums/newtopic/ID/process/
modrewrite
Started by Hip Hop Artist, Aug 18 2008 02:36 PM
4 replies to this topic
#1
Posted 18 August 2008 - 02:36 PM
#2
Posted 19 August 2008 - 01:04 AM
Mmmk, so what have you tried? I can tell you this much, depending on what exactly you did, the '.*' at the end there will probably through you off a bit.
Edited by rc69, 19 August 2008 - 01:04 AM.
#3
Posted 19 August 2008 - 05:12 AM
RewriteEngine On
RewriteRule ^forums/newtopic/(.*)/process/ forums/newtopic.php?id=$1&action=process
I think this will do it =)
RewriteRule ^forums/newtopic/(.*)/process/ forums/newtopic.php?id=$1&action=process
I think this will do it =)
#4
Posted 19 August 2008 - 11:17 AM
Assuming process is the only action he wants, and any value can be accepted as an id.
I think this would work a bit better (though, '.*' could be used to match the action rather then the limiting values i have):
I think this would work a bit better (though, '.*' could be used to match the action rather then the limiting values i have):
RewriteRule ^forums/newtopic/([0-9]+)/([a-zA-Z0-9_\-]+)/? forums/newtopic.php?id=$1&action=$2
#5
Posted 19 August 2008 - 01:03 PM
worked. thanks all!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
