1

Cloudflare page rules for removing multiple trailing slash

I want to set up the below things.

https://domain.com// OR https://domain.com// OR https://domain.com/// OR onwards

are redirecting to https://domain.com/

How can I set up this using the Cloudflare page rule?

Subhash
  • 1,586
  • 11
  • 18

1 Answers1

1

It will be quicker to set that in your webserver(Nginx) virtual host than doing it on Cloudflare.

Add below in your Nginx config:

if ($request_uri ~* "\/\/") {
  rewrite ^/(.*)      https://$host/$1    permanent;
}
Jay
  • 1,064
  • 2
  • 12
  • 21