Redirect POST htaccess

前端 未结 1 1504
一向
一向 2020-12-01 19:07

This question is very similar to: Is it possible to redirect post data? (asked eariler) but that answer does not seem to work for me.

I have a form:

         


        
相关标签:
1条回答
  • 2020-12-01 19:55

    Your "add trailing slash" rule forces a header redirect:

     [R=301,L]
    

    a header redirect will drop POST values.

    You will have to drop that rule, or disable it for POST submissions:

    # Forces a trailing slash to be added
    
    RewriteCond %{REQUEST_METHOD}  !=POST
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
    RewriteRule (.*)$ /$1/ [R=301,L]
    
    0 讨论(0)
提交回复
热议问题