I have published some webpage code on GitHub and it is used by quite a few people without issue. But, just recently, a person contacted me to let me know that they are having an issue with an image not displaying properly. The image is generated by a php file and I am using an .htaccess rewrite to refer to the file as .png in URLs but process internally on the web server as .php.
It is my understanding that an apache server should include the original query string in the URI rewrite by default, but this person's web server is not doing such. This is the first person who has reported the issue and I have not been able to duplicate the issue on the web servers I have tested. I am not sure of this person's web server environment.
This is the incorrect image output which the user is reporting:
https://freiezocker-clan.de/bf4stats/common/server-banner/image-banner.png?sid=1
The result returned in the image above says that a server id is required. The sid is in the query string but is being ignored. On other web servers, it has worked fine.
This is what the image output should look like (when avoiding the .htaccess rewrite):
https://freiezocker-clan.de/bf4stats/common/server-banner/image-banner.php?sid=1
This was my .htaccess implementation before the user reported the issue:
RewriteEngine on
RewriteRule ^(.*)\.png $1.php [NC]
This was my attempt to fix (without success) the reported issue:
RewriteEngine on
RewriteRule ^(.*)\.png $1.php?%{QUERY_STRING} [QSA,NC,L]
Could you please explain to me why that user's web server is not including the query string and/or could you please help me implement a change which will correct the issue for that user?
Thank you!