RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} "lftp"
RewriteRule ^.*$ https://fedoraproject.org/wiki/Infrastructure/Mirroring#Tools_to_avoid [R,L]

RewriteRule ^/$ /pub [R=302,L]


RedirectMatch 302 ^/pub/fedora/linux/atomic/(.*$) https://kojipkgs.fedoraproject.org/atomic/$1
RedirectMatch 302 ^/pub/fedora/linux/atomic https://kojipkgs.fedoraproject.org/atomic/
Redirect 302 "/ostree/27" "https://kojipkgs.fedoraproject.org/atomic/repo"
Redirect 302 "/pub/ostree/27" "https://kojipkgs.fedoraproject.org/atomic/repo"

RedirectMatch 302 ^/atomic/repo/deltas/(.*) https://d2uk5hbyrobdzx.cloudfront.net/deltas/$1
RedirectMatch 302 ^/atomic/repo/objects/(.*) https://d2uk5hbyrobdzx.cloudfront.net/objects/$1
RedirectMatch 302 ^/atomic/repo/(.*) https://kojipkgs.fedoraproject.org/ostree/repo/$1

RedirectMatch 302 ^/iot/repo/objects/(.*) https://d35xkejx7yn5rc.cloudfront.net/$1
RedirectMatch 302 ^/iot/repo/(.*) https://kojipkgs.fedoraproject.org/compose/iot/repo/$1
