I've a client project made with Nginx as Web Application. Now I need to convert this Nginx directives to Apache, but there are some directives that doesn't works.
Nginx directive (it works):
- Code: Select all
location ~ /(.*?_trk_).*\.(jpg|jpeg|gif|png|svg|pdf|zip|woff|woff2|JPG|JPEG|GIF|PNG|SVG|PDF|ZIP|WOFF|WOFF2) {
expires 1d;
rewrite ".*_trk_([^_]*)_([^_]*)_([^_]*)_(.*)" -0000000$3#$3#$4#/img/trk_images/$1/$2/$3/$4;
rewrite "-0*?((\d{2})(\d{2})(\d{2})(\d{2}))#([^#]*)#([^#]*)#([^#]*)" $uri break;
try_files /imgn/csm/$2/$3/$4/$5/$6/$7 /img/csm/$2/$3/$4/$5/$6/$7 @notfound-csm;
}
Apache 2.4 (it doesn't works):
- Code: Select all
RewriteEngine on
RewriteCond %{REQUEST_URI} /(.*?_trk_).*\.(jpg|jpeg|gif|png|svg|pdf|zip|woff|woff2|JPG|JPEG|GIF|PNG|SVG|PDF|ZIP|WOFF|WOFF2)
RewriteRule ^.*_trk_([^_]*)_([^_]*)_([^_]*)_(.*)$ -0000000$3#$3#$4#/img/trk_images/$1/$2/$3/$4
RewriteRule ^-0*?((\d{2})(\d{2})(\d{2})(\d{2}))#([^#]*)#([^#]*)#([^#]*)$ /imgn/csm/$2/$3/$4/$5/$6/$7
This is an example of the image uri: http://images.domain.dev/_trk_dealer_37556_805784_b_805784_25203968.jpg
Images are stored inside this pattern path:
/imgn/csm/01/02/14/56/1021456/b_805784_25203968.jpg
Apache reply me with 404... Why?
Can someone helpme to translate it?
Thanks in advance