Add slash to the end of every url (need rewrite rule for nginx)

前端 未结 9 866
慢半拍i
慢半拍i 2020-11-28 03:28

I try to get an \"/\" to every urls end:

example.com/art

should

example.com/art/

I use nginx as webserver.

I need the rewrite rule f

9条回答
  •  一向
    一向 (楼主)
    2020-11-28 03:56

    Try this: ^(.*)$ http://domain.com/$1/ [L,R=301]

    This redirects (Status code 301) everything ($1) without a "/" to "$1/"

提交回复
热议问题