We have our site running on HTTPS. Is there a way to accept HTTP request for URLs containing /public/? For all other HTTP requests they should be redirected to HTTPS.
I have RoR application running on apache + passenger.
EDIT
Since the assets (/public/) requests will explicitly be on HTTP, how about creating another VHOST to handle HTTP requests. And for any requests other than /public/ directly could be redirected to HTTPS? If we can go this way how can we set this up in VHOST for HTTP?
EDIT 2
I am sorry, I should have been elaborated this in first place. Here is our setup. There two separate applications. One is running on HTTPS (S) and other on HTTP (P). The app P fetches data (a full HTML page, call it page) from S and render to client. The CSS file used in page is located on ‘S’ so I need to HTTPS in CSS link. I want to use HTTP instead to refer the CSS.
You can use
mod_rewriteand place a.htaccessfile with the below contents in yourDocumentRoot.