Page 1 of 1
Search engine optimization
Posted: Tue Jun 27, 2006 6:13 pm
by phpCCore Brad
I wrote an .htaccess that forwards any file in a directory to one php script.
Code: Select all
RewriteEngine on
RewriteRule ^([A-Za-z0-9._%-]+)/?$ /index.php?pageLoader=true&cmd=$1
The problem is I am facing is that post variables don't transfer obviously. I can get the GET variables but not the post variables. Can anyone help me with this? It's a big problem I am facing.
Posted: Tue Jun 27, 2006 6:23 pm
by RobertGonzalez
Post vars are going to be sent. You just need to check for them. And if you are accepting any url past / to be redirected, then a simpler regex could be...
Code: Select all
RewriteEngine on
RewriteRule ^(.+)/?$ /index.php?pageLoader=true&cmd=$1
Posted: Tue Jun 27, 2006 6:33 pm
by Robert Plank
Everah wrote:Post vars are going to be sent. You just need to check for them. And if you are accepting any url past / to be redirected, then a simpler regex could be...
Hmm... are you sure the post vars will be sent... you can't GET and POST at the same time, or can you if it's an internal Apache request instead of an HTTP redirect?
Posted: Tue Jun 27, 2006 6:44 pm
by Robert Plank
Those htaccess directives don't even work on my server, maybe that's just because I'm still on Apache 1.
Posted: Tue Jun 27, 2006 11:59 pm
by RobertGonzalez
Robert Plank wrote:Everah wrote:Post vars are going to be sent. You just need to check for them. And if you are accepting any url past / to be redirected, then a simpler regex could be...
Hmm... are you sure the post vars will be sent... you can't GET and POST at the same time, or can you if it's an internal Apache request instead of an HTTP redirect?
Yes, I'm sure. Let say you post a form with the following action: formpost.php?issent=1. Whatever the form posts is getting sent by $_POST, plus there is the $_GET['issent'] var. I know this because I am using this on a mod_rewrite'ed app I just developed. Everything get's throw through page.php?p=somepagename. Form posts still post to that query stringed page.