apache - Redirecting all HTTPS to HTTP except two pages -
i tried other topics on site faced redirect loop error.
my current htaccess code:-
rewriteengine on rewritecond %{server_port} ^80$ rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l] rewriterule ^([^.]+)/?$ index.php?v=$1 [qsa,l] rewriteengine on rewritecond %{server_port} ^443$ rewritecond %{http_host} !^www\. rewriterule ^(.*)$ https://www.%{http_host}/$1 [r=301,l] rewriterule ^([^.]+)/?$ index.php\?v=$1 [qsa,l]
the above not related question proper you, have included it.
now want redirect https urls http except 2 /login/ , /register/
how can ensuring use minimum conditions.
unless wedded using .htaccess, @ top of pages want go http check php , use header location send them http.
if($_server['server_port'] == 443) header('location: http://'.$_server['http_host'].'/'.$rest_of_path);
there info here on how construct whole url go same page. getting full url of current page (php)
Comments
Post a Comment