Apache2 redirect all but some pages back to http using vhosts -


I use some types of pages to redirect the HTTPS to the vhosts to rewrite the rules with Apache 2 I am using It is anything that starts with mydomain.com/users In other words, all pages to be done with users and their information should be on HTTPS. I want to redirect all other pages to http.

What happens now when a user goes to the / user page, then they are redirected to HTTPS properly. But when he goes away from the / user> area, I can not get back to the redirected HTTP

I need the terms and conditions to rewrite anything that In that other words, please help me fill in the blank:

  Rewind Conduit% {SERVER_PORT} ^ $ 443 Rewrite code% {REQUEST_URI} __blank__RewriteRule __blank__ http: //mydomain.com% {REQUEST_URI} [R = 301, L]   

researching this , I am trying a few things that I avoid. I need a wildcard under / user because I'm developing the app and often add pages to users (this is a Rail app)

I understand that Matching a knot with regular expressions is not easy. What I am trying to do is the bulk of the site running on HTTP except the / user / * pages on HTTPS.

In addition, yes, I have a valid proof and yes I have verified that Apache 2 rewrite mode works. I can rewrite all the url no problem at http. How can I not rewrite people starting with / user in REQUEST_URI? I think I've tried about every answer on this site so far ...

There are a lot of answers to this type of question - you have to search this site a little, yes, they do not answer 100% of your question directly (as all have different requirements - such as separate page names etc), but The whole perspective is the same.

In any case here - how can this be done:

  option + follow link - multimedia revive on rewritebase / # images / css / js (somehow Do not do anything for the protocol). (Gif | jp? G / png | css | js) $ - [NC, L] RSR / RUR write code for # users / *% {HTTPS} = REERRRR ^ / users / https: //% {HTTP_HOST}% {REQUEST_URI } = R = 301, L] # For all other URLs Force #Reverectcode% {HTTPS} =% {REQUEST_URI} on the Rewind Conduction! ^ / Users / RewriteRule * Http: //% {HTTP_HOST}% {REQUEST_URI} [R = 301, L] #   
  1. The other rules given below include any of the virtualhost instructions Other writing rules should be placed before (if present). if placed elsewhere may require some small tweaking.

  2. They

    • Force HTTPS for all resources <
    • For images, CSS styles and JavaScript files Nothing (will be accurate for the file with those extensions)
    • and will force HTTP for: / user / ,
    • all other URLs Important note: It is very likely that this rule will not work for you immediately. The reason for this is that the modern browser redirects cache 301 to your previous efforts. So I recommend testing it on any other browser and change between 301 and 302 (302 not cached) during testing .. or clear all browser cache (maybe even history) and restart the browser.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -