.htaccess - Apache HTTPS -> HTTP -> HTTPS 301 redirect -


i experiencing issue if rewriterule meets in .htaccess, 301 redirect https http https

for instance, if i've 301 redirect rule follows

rewriterule ^/products/?$ /en/products/ [r=301,l] 

then is

+------------------------------------+ | https://example.com/products/      | +----------------+-------------------+                  |                  v +----------------+-------------------+ | http://example.com/en/products/    | +----------------+-------------------+                  |                  v +----------------+-------------------+ | https://example.com/en/products/   | +------------------------------------+ 

any idea, might cause this?

you have rewrite https somewhere, right?

remove l flag. [r=301,l] -> [r=301]. l means last , doens't @ rules listed beneath that. should if https rewrite after one.

another option can direct straight there:

rewriterule ^/products/?$ https://{http_host}/en/products/ [r=301,l] 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -