I have an image folder that only HTTPS should be accessible to. How to redirect all requests from HTTP to HTTPS?
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
That should do it.
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
The search keyword is the next time you want to learn how to redirect something: mod_rewrite
Source: https://habr.com/ru/post/1779492/More articles:NHibernate + ViewModel + MVC + Optimistic Lock - lockingFunctional Memory - c ++cache.html gwt size and slow loading - cachingJetty server refuses connections 127.0.0.1 - jettyKRL twitter search and application / entity variables available for all rules? (Global) - global-variablesHow to use the g ++ compiler in the IDS environment of the visual studio MS - c ++How can I say that the Samsung Galaxy Tab cannot place phone calls? - androidHow to specify the default value for a field in a JDO object for appengine? - javaNo pitch audio - language-agnosticHow do you initialize a vector of structures that contain vectors as members? - c ++All Articles