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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -