Basically having {uri}
will make a request to http://www.example.com/some/path
redirect to https://example.com/some/path
, whereas if you remove {uri}
it would redirect to https://example.com
, i.e. lose the path portion. It’s nicer for users if they clicked a link from somewhere else to actually go to the page they wanted to go to when redirecting, instead of throwing them back to the root of the site.
Adding permanent
changes the HTTP status code used in the redirect response. As noted in the docs, the default is “temporary”, i.e. 302
. The difference is that a 301
/permanent redirect will be remembered by the browser to avoid the extra roundtrip, and also any bots/crawlers might use that to determine that forget the old URL and only keep the final destination. Just google “difference between 301 and 302” and you’ll find plenty of explanations.