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)
精彩评论