Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having an upload Java applet to handle large files upload. The use of this upload is mandatory, so dropping it is not an option. The problem is that, after the upload, the applet redirects to a given url and sends some info through $_GET. I can't change that ( the sending method, the params order ). And the last param sent is the filename. So the redirect link looks like this :


Now, the problem is that the Apache handles this link like it was a PDF file ( raises 404 error ), not index.php with lots of query params. If instead of filename.pdf I have some other type of file it works perfectly. I tried some tricks with the .htaccess, I'm guessing that's where I should work, but not really experienced.

Any ideas ?


Gabriel Poama-Neagra

share|improve this question

migrated from stackoverflow.com Oct 18 '10 at 21:29

This question came from our site for professional and enthusiast programmers.

2 Answers 2

You could try to redirect all requests to index.php with mod_rewrite (or all requests containing index.php somewhere). An other option would be to set the index.php as the 404 error document but this sure is a dirty hack.

But the behaviour you're desribing is strange anyway so maybe you should check your request-path - maybe it redirects you to some other path with no index.php. An other option could be that there's some pdf-specific rule overwritting the default apache behaviour in your config-files.

share|improve this answer
Already using SEF URL, so all requests go to index.phpl; I'll recheck the .htaccess file that handles this, although there is no special rule to handle pdf files. –  Gabriel Poama-Neagra Oct 18 '10 at 13:00
I just added a rule to .htaccess to force index.PHP to handle PDF files, luckily I don't have any real PDF available to download. Thanks, and sorry for your trouble. –  Gabriel Poama-Neagra Oct 18 '10 at 13:03

Sorry for your trouble. The problem was fixed by adding a rule in the .htaccess file, that forced index.php to handle PDF files. The needed lines for the .htaccess file :

RewriteEngine On
RewriteCond %{REQUEST_URI} (.*).pdf$
RewriteRule ^([^\.]+)$ index.php?params=$1 [L]

The internal logic to handle SEF urls was already there.

Once again, sorry for your trouble

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.