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?

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;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.