rewriteengine on rewritecond %{HTTPS} =on rewritecond %{request_uri} ^/foo [NC] rewriterule ^/foo/(.*) bar/$1