Page 1 of 1

dynamic rewriting using both get and post

Posted: Sat Aug 09, 2008 12:17 pm
by bertsmilsky
Hi there,

I want to be able to rewrite urls turning gets into search engine friendly urls. At the same time i have a contact form and i want to be able to use gets to produce error messages. For example:

In .htacces:
RewriteEngine On
Options +FollowSymlinks
RewriteRule ^([A-Za-z0-9-]+)/$ /?page_url=$1 [L]

So this URL works fine:
http://www.logfc0809wip.thewebmill.co.uk/contact/
echo $_GET['page_url']; /*Output is 'contact'*/

And so do these:
http://www.logfc0809wip.thewebmill.co.uk/contact/?msg=sent
http://www.logfc0809wip.thewebmill.co.uk/contact/?msg=senderror
echo $_GET['page_url']; /*Output is 'contact'*/
echo $_GET['msg']; /*Output is nothing*/

So $_GET['msg'] produces nothing. Is there a way to do this? Any suggestions?

Many thanks

Re: dynamic rewriting using both get and post

Posted: Sun Aug 10, 2008 4:53 am
by filippo.toso
Add the QSA flag to your RewriteRule