Posts: 93
Location: Melbourne, Australia
|
Hi all,
I have a question about using rewrites in php/apache.
One thing i cannot seem to figure out is this.
I have for example a feedback page. This page is accessed through a list of users so you can provide feedback for a user. The link needs to pass the ID of the user so the page knows which user you are commenting on. The link is like this:
Code:
<a href="feedback/44243/">user</a>
And the rewrite rule is like this:
Code:
RewriteRule ^feedback/([0-9]+)(/)?$ index.php?dir=users&file=feedback&userid=$1
As you can see my rule is requires you to pass an ID. Fair enuf.
However, this page has a form which submits to itself so it can process the feedback and display a un/successful message. Therefore, if the form submits to itself, i don't need to pass the ID through the querystring anymore since i can use hidden form variables, so, i want to the action of the form to be:
The problem is that from the above rule, i have set the rule to require variables. If i define another rule for feedback without the variables, it won't find the page. Therefore im forced to set the action to include the userid again - which i'd prefer not to.
What am i doing wrong or is there better way i should be doing this?
Thanks in advance.
|