apache - Redirect to SSL except when URL matches a certain criteria -
this htaccess code: rewriteoptions inherit rewriteengine on rewritecond %{server_port} 80 rewriterule ^(.*)$ https://www.domain.com/$1 [r=301,l] adddefaultcharset utf-8 rewritecond %{http:authorization} ^(.*) rewriterule ^(.*) - [e=http_cgi_authorization:%1] rewritecond %{request_filename} !-f rewriterule ^([0-9a-za-z]{12})(\/.+|\.html?|$) /cgi-bin/index_dl.cgi?op=download1&id=$1&fname=$2 [l] rewriterule ^ot:(.*) /cgi-bin/index_dl.cgi?op=download1&otid=$1 [l,b] currently redirecting ssl. want when filename fulfills criteria rewriterule ^([0-9a-za-z]{12})(\/.+|\.html?|$) /cgi-bin/index_dl.cgi?op=download1&id=$1&fname=$2 [l] it needs allow non-ssl i've googled , googled can't figure out how this. any appreciated :) in rule redirect, add exclusion condition: rewritecond %{https} off rewritecond %{request_uri} !^/([0-9a-za-z]{12})(\/.+|\.html?|$) rewriterule ^(.*)$ https://www.domain.com/$1 [r=301,l] or ...