I have a website mirrored with wget
and I'd like to serve it via Apache. The problem is that I can't access files with special chars. For example, I have files with names like this:
$ ls -N components/com_flexicontent/librairies/phpthumb/ | head -4
phpThumb.php?src=%2Fimages%2Fpiekny-wschod%2Ffestiwal-globtroterski-lublin2020-karuzela.jpg&w=290&h=177&aoe=1&q=95
phpThumb.php?src=%2Fimages%2Fdrezyny-rowerowe.jpg&w=90&h=90&aoe=1&q=95
phpThumb.php?src=%2Fimages%2FEko-Karpaty.jpg&w=90&h=90&aoe=1&q=95
phpThumb.php?src=%2Fimages%2FHotel_Anders_SPA.jpg&w=90&h=90&aoe=1&q=95
So phpThumb.php?src=%2Fimages%2Fpiekny-wschod%2Ffestiwal-globtroterski-lublin2020-karuzela.jpg&w=290&h=177&aoe=1&q=95
refers to a single file in folder.
When I try to read this file in web browser, I get "File not found":
https://xxxx/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=/images/piekny-wschod/festiwal-globtroterski-lublin2020-karuzela.jpg&w=290&h=177&aoe=1&q=95
This is my .htaccess
:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
RewriteCond %{QUERY_STRING} ^src=/images/piekny-wschod/(.*)$
RewriteRule ^components/com_flexicontent/librairies/phpthumb/phpThumb.php?$ components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=%2Fimages%2Fpiekny-wschod%2F%1 [NE,L]
</IfModule>
I've tested making many different rules and they work for file names without ampersands. E.g. this works:
RewriteRule ^components/com_flexicontent/librairies/phpthumb/phpThumb.php?$ components/com_flexicontent/librairies/select2/select2.css [NC,L]
I've tried rules with flags NE
, B
, no effect.
&
is actually part of the filename on disk? It's not a URL parameter that should be passed to thephpThump.php
script?!wget
mirrored some PHP-based site that way.phpThumb.php?src=...
part is part of the filename?