.htaccess - htaccess rewrite rule tweak -
i have website https installed. need ensure pages (except ones intentionally https) forced show on non-https. https installed on domain-name.com/ssl-directory/what-ever-page-goes-here/
so, pages after domain-name.com/ssl-directory/
should keep https (they now) , other (including domain-name.com/ssl-directory/
should forced non-https).
so far, i've got it's not working , i'm not expert htaccess redirects, don't know why.
rewriteengine on rewritecond %{https} =on rewritecond %{request_uri} !^ssl-directory/(.*) rewriterule .* http://%{server_name}%{request_uri} [r,l]
as said, i'm not expert in this, think should mean =>
turn rewriteengine
on
if https
and
if request_uri
not child of ssl-directory
rewrite same page, http
obviously i'm doing wrong, appreciated.
thanks
replace code this:
rewriteengine on rewritecond %{https} on rewritecond %{request_uri} !^/ssl-directory(/.*|)$ [nc] rewriterule ^ http://%{http_host}%{request_uri} [r=301,l]
better use http_host
instead of server_name
, %{request_uri}
has /
@ start.
Comments
Post a Comment