== Steps to reproduce ==
1. start with a standard MediaWiki setup
2. set $wgGenerateThumbnailOnParse = false;
3. create a .htaccess file in the MediaWiki root directory
4. copy these rules into it:
```
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-l
RewriteRule ^images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/[^/]+/[^/]+$ /thumb_handler.php [L,QSA]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-l
RewriteRule ^images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/[^/]+/[^/]+$ /thumb_handler.php [L,QSA]
```
...and images will break because these rules are disabled by the lower-level .htaccess file. Is this correct?
== Original description ==
I have enabled TransformVia404 by $wgGenerateThumbnailOnParse = false; and it's works, BUT without images/.htaccess. With images/.htaccess new images return 404 Not Found, but previously generated images (via TransformVia404) work!
Description: Ubuntu 12.04.4 LTS
Server version: Apache/2.2.22 (Ubuntu)
Server built: Mar 19 2014 21:11:10
Contents of file:
```
# Protect against bug 28235
<IfModule rewrite_module>
RewriteEngine On
RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|\?|$) [nocase]
RewriteRule . - [forbidden]
</IfModule>
```
I'm not so good in mod_rewrite so don't know what actually wrong.
I'm also tried to delete from /.htaccess all rules except required for TransformVia404 with no success:
```
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-l
RewriteRule ^images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/[^/]+/[^/]+$ /thumb_handler.php [L,QSA]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-l
RewriteRule ^images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/[^/]+/[^/]+$ /thumb_handler.php [L,QSA]
```
--------------------------
**Version**: 1.23.0
**Severity**: normal