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
Post a Comment