Search engine optimization

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
phpCCore Brad
Forum Commoner
Posts: 47
Joined: Sun Dec 04, 2005 5:46 pm
Location: Michigan, USA
Contact:

Search engine optimization

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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
Robert Plank
Forum Contributor
Posts: 110
Joined: Sun Dec 26, 2004 9:04 pm
Contact:

Post 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?
Robert Plank
Forum Contributor
Posts: 110
Joined: Sun Dec 26, 2004 9:04 pm
Contact:

Post by Robert Plank »

Those htaccess directives don't even work on my server, maybe that's just because I'm still on Apache 1.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
Post Reply