htaccess redirect for non-www both http and https

Try this rule: RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Here’s an explanation: The first condition tests if the HTTP header field Host has the required format (contains exactly one period). The second condition tests if the concatenated value of the value of the HTTPS variable (values on and off) and s … Read more

How can I make Android Volley perform HTTPS request, using a certificate self-signed by an Unknown CA?

i have implemented https by creating new requestQueue in my volley class by the following code public RequestQueue getRequestQueue() { if (mRequestQueue == null) { mRequestQueue = Volley.newRequestQueue(getApplicationContext(), new HurlStack(null, newSslSocketFactory())); } return mRequestQueue; } private SSLSocketFactory newSslSocketFactory() { try { // Get an instance of the Bouncy Castle KeyStore format KeyStore trusted = KeyStore.getInstance(“BKS”); … Read more

How to keep changed form content when leaving and going back to HTTPS page? (works with HTTP)

You can consider the following solutions: The autocomplete Attribute (HTML5) This seems unrelated since autocomplete tells the browser to complete fields with the values based on earlier user input which were “submitted” with the form. But in my tests I saw that; after filling out the form without submitting; when I hit the forward (history) … Read more

Android HttpClient and HTTPS

This should get you started. I’m using basically the same, except with ThreadSafeClientConnManager. SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme(“https”, SSLSocketFactory.getSocketFactory(), 443)); HttpParams params = new BasicHttpParams(); SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry); HttpClient client = new DefaultHttpClient(mgr, params);

git clone with HTTPS or SSH remote?

GitHub have changed their recommendation several times (example). It appears that they currently recommend HTTPS because it is the easiest to set up on the widest range of networks and platforms, and by users who are new to all this. There is no inherent flaw in SSH (if there was they would disable it) — … Read more

How can I have CodeIgniter load specific pages using SSL?

There are few ways to tackle this. Option 1: I would probably have the code deployed to both folders, then in the file: /system/application/config/config.php, set your page to: $config[‘base_url’] = “”; or $config[‘base_url’] = “”; Then in your non-ssl VirtualHost folder, set your config to redirect protected pages by folder to the SSL site: RedirectPermanent … Read more

Redirecting from HTTP to HTTPS with PHP

Try something like this (should work for Apache and IIS): if (empty($_SERVER[‘HTTPS’]) || $_SERVER[‘HTTPS’] === “off”) { $location = ‘https://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]; header(‘HTTP/1.1 301 Moved Permanently’); header(‘Location: ‘ . $location); exit; }