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

ios - Change Storyboard View using Seague -

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -