mod_rewrite HTTPS and Single Point of Entry

I've been fighting mod_rewrite for a while now - I cannot make it work so it does a "if the file doesn't exist, redirect to index.php"-redirection, as used by most single-point-of-entry frameworks such as Slim, CI, Symfony2, while also redirecting any HTTP requests to HTTPS.

It looks like this, which works, but allows HTTP:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^ index.php [QSA,L]

I tried:

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

Which gave me a redirect loop.

What's the correct way to do this with mod_rewrite? I want it to first redirect HTTP to HTTPS, then on the following request redirect everything that doesn't exist to index.php, but serve anything that does.

I cannot use the Redirect Virtual Host directive, as the servers are behind a load balancer and only listen on port 80.

Mod rewrite redirect one file to a file on another domain

I have been at this for a number of hours and cannot get this to work. I have other redirects in this .htaccess file that do work.

I need to redirect as follows. to

Note that and both point to the same root directory.

Here's my code.

RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteCond %{REQUEST_URI} !^/pi_www/hardface/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /pi_www/hardface/$1
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ postle_hft/index_hft.php [L]

I have tired all the permutation of this I can think of and nothing works. I really would appreciate some help.

Setup Updated Apache Http Components for android

I use a code with apache HttpClient 4.5 thats works fine in a separated java aplication, when I bring to android project I have this error

java.lang.nosuchfielderror org.apache.http.conn.ssl.allowallhostnameverifier


SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(,new HostnameVerifier(){
            public boolean verify(String arg0, SSLSession arg1) {
                return true;

I import the same libs , i googleit and says a duplicate reference or a jar missed but nothing I download the jar from here If the problems is in the jars that are no compatible with android I like to find the correct jars without using gradle maven or something like this because the mayor time im offline and when online only can navigate the web Thanks

Java 8: Apache HttpClient failing authentication

I am attempting to use Apache HttpClient API to access Atlassian Confluence wiki pages.

Here is my code:

public class ConcfluenceTest{

    public static void main(String[] args) {
        String pageID = "107544635";
        String hostName = "valid_hostname";
        String hostScheme = "https";
        String username = "verified_username";
        String password = "verified_password";
        int port = 443;

        //set up the username/password authentication
        BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
            new AuthScope(hostName, port, AuthScope.ANY_REALM, hostScheme),
            new UsernamePasswordCredentials(username, password));

        HttpClient client = HttpClientBuilder.create()

        try {

            HttpGet getRequest = new HttpGet("valid_url");

            HttpResponse response = client.execute(getRequest);

            //Parse the response
            BufferedReader rd = new BufferedReader(
                new     InputStreamReader(response.getEntity().getContent()));
            StringBuffer result = new StringBuffer();
            String line = "";
            while ((line = rd.readLine()) != null) {


        } catch (UnsupportedEncodingException e) {
        } catch (IOException e) {


When I attempt to execute this code, the printed response is the HTML of the Log In screen, which means that the authentication failed. This code does, however, return the correct response when I provide it with the URL to a page that is not restricted to registered users (i.e credentials aren't required). I also tried all permutations of port/scheme.

Can someone tell me what I am missing?

.htaccess file to get rid of image extensions

Currently I have a .htaccess file that will get rid of a .png extension at the end of an image (example: would be able to be accessed from

Now, this script works perfectly fine, HOWEVER, I need to know how I can add support for .gifs, .jpgs, etc. (example: would be able to be accessed from

My code so far:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) /images/$1.png [QSA,L]

ErrorDocument 404
ErrorDocument 500

Thanks guys! :)

psycopg2 error if called via fcgi

I have a flask application I want to deploy on a shared host. It uses psycopg2 and is deployed via apache as a fcgi app via flipflop. Everything works fine when tested or when manually called (python and then executing queries works).

If I try to access it via the apache server the flask app works fine until it tries to use psycopg2 to access the database.

ImportError: /home/syntonym/project/env/lib/python3.4/site-packages/psycopg2/ undefined symbol: lo_truncate64

The psycopg2 FAQ has a note on that:

if the message reports undefined symbol: lo_truncate64 it means that Psycopg was built with large objects 64 bits API support (i.e. the libpq used at compile time was at least 9.3) but at runtime an older libpq dynamic library is found.

and to avoid that problem:

You can use: $ ldd /path/to/packages/psycopg2/ | grep libpq to find what is the libpq dynamic library used at runtime.

You can avoid the problem by using the same version of the pg_config at install time and the libpq at runtime.

$ ldd /home/syntonym/project/env/lib/python3.4/site-packages/psycopg2/ | grep libpq => /package/host/localhost/postgresql-9.3/lib/ (0x00007fc4f7b30000)
$ pg_config
LIBDIR = /package/host/localhost/postgresql-9.3.2-1/li2b

I also tried to compile psycopg2 with LD_LIBRARY_PATH="/package/host/localhost/postgresql-9.3.2-1/lib". ldd showed then the exact same lib as pg_config, but the same error persists.

The fgci script is as following:


import sys
sys.path.insert(0, "/home/syntonym/project")

from flipflop import WSGIServer
from myapp import app

if __name__ == "__main__":

How comes that the dynamic linked library is wrong if executed via apache? Or is there a different cause for that error?

XAMPP, WAMP, SIMILAR: Slow speed with xdebug

I use XAMPP on windows 7, with Visual Studio and XDebug. But in 2 years not solved the big problem, and now im very frustrated. Localhost Wordpress websites in my localhost xampp server are very too slow.

Load a page take 3-4 seconds with XDebug enabled, 1-2 seconds if disabled. This is incredible for many reasons like:

1) My PC is super fast: 2xSSD, 16GB RAM, 8CORE CPU, but XAMPP not use my power and stay slow.

2) When website is live on a shared hosting of 80$/years, it is more fast.

With this situation performance seem not related to PC power, so I think if i have for example 128GB RAM, 10xSSD in RAID and more, performance stay same. But how can be this possible?

I already tried all solutions found on web:

1) Enabled PHP accellerator (not change nothing)

2) Enable / disable lots of php.ini options

3) Encrease php memory limit

4) Change host file of windows.

Nothing improve performance. I not think i will found a solution, but if there is someone that can explain me why hardware can not improve performance is almost a useful info :)

Thank you!

Codeigniter htaccess issue with wordpress

I am facing an issue, although there are many answers to it but none seems to work.

I have a hosting where wordpress is installed. Within there I created a folder and installed codeigniter. Somehow I have managed to remove index.php from url, but the css & other files within iscaffold are not working.

Here are the .htaccess files.


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L] 
# END WordPress


<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /lastwish
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

The url:

You can view source and see the css & js files are redirecting.