RewriteEngine On

# reject annoying porn.com referrers
RewriteCond %{HTTP_REFERER} ^http://www.porn.com.*
RewriteRule (.*) - [F]

#RewriteCond %{REQUEST_URI} ^/pub/fedora/linux/.*[/]+ia64.* [OR]
#RewriteCond %{REQUEST_URI} ^/pub/fedora/linux/.*[/]+sparc.*
#RewriteRule ^/pub/fedora/linux/(.*) /pub/fedora-secondary/$1

RewriteRule ^/$ https://getfedora.org/ [R=302,L]

# http connection, return http mirrors
RewriteCond %{HTTPS} "off"
RewriteRule ^/(.+) http://localhost:10002/mirrorlist?path=$1&redirect=1&protocol=http  [P,QSA,L]
# https connection, return https mirrors
RewriteCond %{HTTPS} "on"
RewriteRule ^/(.+) http://localhost:10002/mirrorlist?path=$1&redirect=1&protocol=https [P,QSA,L]

ProxyPassReverse / {{proxyurl}}/
