开发者

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 开发者_JAVA百科loses all the POST info ($_POST in PHP is blank)

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


Put this in the line before:

RewriteCond %{REQUEST_METHOD} !POST


RewriteCond %{THE_REQUEST} ^GET

before your RewriteRule. (works on Apache 1.3 too)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜