Naming convention causes 500 Internal Server Errors
Posted by Brandon Elliott on 06 March 2016 06:08 PM
|
|
Over the years, we have seen that some users want to save their website screenshots with a simple and obvious naming convention like: domain.tld.jpg For instance: cnn.com.jpg bing.com.jpg In these cases, however, the web server (Apache in our testing) may try to run images as executables when they match certain extensions. For instance, since Polish TLDs (.pl) would be saved as domain.pl.jpg, many installations of Apache would see this as a Perl file and attempt to process it as such, resulting in a 500 Internal Server Error. One of our users suggested some code to handle Polish domains: if(ereg("\.pl$", $url)) { $url = str_replace('.pl','.pol',$url); } However, there may be others that would need to be handled as well. So, we are providing a small .htaccess modification to prevent all of these types of issues: <Directory "/path/to/your/thumbnail/directory"> Options -ExecCGI -MultiViews AllowOverride All </Directory> This should prevent any issues, provided that you do not keep executable files in the website thumbnail directory. | |
|