mod_rewrite does not forward GET parameters

Solution 1:

Have you tried using the QSA (Query String Append) flag?

RewriteRule ^static/([^/]+)/([^/]+) /static.php?sISOCode=$1&sPage=$2 [QSA]

EDIT, AND ACTUAL ANSWER BELOW:

This problem is caused by Apache's mod_negotiation, in particular the MultiViews option you are using:

The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements.

Enabling Multiviews tells Apache to guess which file to use when the URI does not actually point to an existing location.

Solution:

Disable multiviews by either using -MultiViews in your .htaccess or leaving it out all together.

Solution 2:

The solution was to change the Apache configuration, like this:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName project.example.com

        DocumentRoot /home/veg/workspace/project
        <Directory /home/veg/workspace/project>
                Options FollowSymLinks
                # AllowOverride All
                # Order allow,deny
                # allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
</VirtualHost>

I don't know why this works, however