regex - HTTPS redirect for directory doesn't work correctly -


My goal is to emphasize HTTPS on the admin directory of my site However, normal methods Use from abnormal results. Here is the content of .htaccess :

  Reviving OnRightRound% {SERVER_PORT} 80 Restructured% {REQUEST_URI} Manager Rev. .domain.com / admin / $ 1 [R, L]  

However, when I try to open http://www.domain.com/admin/home.php Instead of redirecting to , https://www.domain.com/admin/home.php , click on https://www.domain.com/admin/ Sends admin / home.php .

So such a sequence makes the admin / section of the URL twice.

I tried to make the last change .htaccess to rev.title ^ (. *) $ Https://www.domain.com/$1 [R, L] The line of (which does not understand me, but still tried to do it) and it redirected to the same wrong URL, which confuses me further.

I am not sure that this should be the case, but I too have been doing this, and why is this the solution?

This is due to / admin / in your target URL Change the rule to:

  Reviving OnRyRightCound% {SERVER_PORT} 80 Restartraye ^ admin (/.*)?$ https: //www.domain.com% {REQUEST_URI} [R, L, NC]  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -