apache - Https to http with variant exceptions -


our site going switched ssl we're not ready it. such going redirect https urls http in htaccess. i've got working added complication we've got few urls have exceptions redirect. these urls are: somebody.dev.www.example.com example.com/top_deal example.com/watches

i have redirect working so: rewritecond %{http:x-forwarded-proto} =https rewriterule ^(.*)$ http://%{http_host}%{request_uri} [l,r=302]

but can't exceptions work. i've tried literally every solution online can find.

you can use rule first rule:

rewriteengine on  rewritecond %{http_host} !=somebody.dev.www.example.com rewritecond %{the_request} !\s/+(?:top_deal|watches)/?[?\s] [nc] rewritecond %{http:x-forwarded-proto} =https rewriterule ^ http://%{http_host}%{request_uri} [l,r=301,ne]  # rest of rules go here 

make sure clear browser cache before testing.


Comments