Nginx redirect urls with slash to non slash for GET action only -


we need redirect urls ending slash non slash version 301. need url have action.

we wrote below

location ~ ^([^.\?]*[/])$ {          if ($request_method = ) {             rewrite ^/(.*)/$ /$1 permanent;          }          if ($request_method != ) {           rewrite / /index.php;          } } 

it working , not sure 100% correct code. suggestions ?


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -