Apache rewrite rule which works with or without a trailing slash

后端 未结 4 1749
南旧
南旧 2021-02-04 01:27

I\'m trying to redirect a series of static URLs, and I want it to work whether or not the trailing slash is present:

/foo/bar  --->  /tacos
/foo/bar/  -->          


        
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 01:51

    This also works: RedirectMatch 301 /foo/bar(/.*|$) http://url.com/tacos

提交回复
热议问题