alex
alex

Reputation: 490273

Help with a form being submitted and .htaccess rule

I use this rule so all URLs have a trailing slash

rewriteRule ^(([a-z0-9\-]+/)*[a-z0-9\-]+)$ $1/ [NC,R=301,L]

it will convert /about to /about/

The problem is, however, if I submit a form (POST) to /about, when it rewrites to /about/, it loses all the POST info ($_POST in PHP is blank)

is there a way to rewrite it for everything except POST'd queries?

Upvotes: 0

Views: 86

Answers (2)

Pindatjuh
Pindatjuh

Reputation: 10526

RewriteCond %{THE_REQUEST} ^GET

before your RewriteRule. (works on Apache 1.3 too)

Upvotes: 0

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798686

Put this in the line before:

RewriteCond %{REQUEST_METHOD} !POST

Upvotes: 2

Related Questions