How to find why is not working RewriteRule?

Hello.
Faced with the apparently banal situation, but he is unable to solve it. You need to make rewrite from this URL:
http://domain.tld/index.php?w=650&h=content&i=madam/rdo_map_nazar_1_sm.jpg

To this:
http://domain.tld/650/content/madam/rdo_map_nazar_1_sm.jpg

To implement in htaccess I wrote the following:
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /index.php?w=$1&h=$2&i=$3 [L]

In apache2.conf:
<Directory /home/mo45/www>
 Options Indexes FollowSymLinks
 AllowOverride All
 Require all granted
</Directory>

In vhost'e is:
<VirtualHost *:80>
 ServerAdmin email@gmail.com
 ServerName domain.tld
 DocumentRoot /home/mo45/www/rockstar/weazel
 <Directory "/home/mo45/www/rockstar/weazel/">
 Options +FollowSymLinks -MultiViews
 RewriteEngine On
 AllowOverride ALL
 Allow from all
</Directory>
 LogLevel alert rewrite:trace3
 ErrorLog /home/mo45/www/rockstar/log/error.log
 CustomLog /home/mo45/www/rockstar/log/access.log combined
</VirtualHost>

In the logs the following:
[Tue Dec 10 14:20:08.457690 2019] [rewrite:trace3] [pid 3897] mod_rewrite.c(482): [client 141.101.104.182:60012] 141.101.104.182 - - [domain.tld/sid#7f3bd4704a30][rid#7f3bcb27f0a0/initial] [perdir /home/mo45/www/rockstar/weazel/] add path info postfix: /home/mo45/www/rockstar/weazel/650 -> /home/mo45/www/rockstar/weazel/650/content/madam/rdo_map_nazar_1_sm.jpg
[Tue Dec 10 14:20:08.457929 2019] [rewrite:trace3] [pid 3897] mod_rewrite.c(482): [client 141.101.104.182:60012] 141.101.104.182 - - [domain.tld/sid#7f3bd4704a30][rid#7f3bcb27f0a0/initial] [perdir /home/mo45/www/rockstar/weazel/] strip per-dir prefix: /home/mo45/www/rockstar/weazel/650/content/madam/rdo_map_nazar_1_sm.jpg -> 650/content/madam/rdo_map_nazar_1_sm.jpg
[Tue Dec 10 14:20:08.458039 2019] [rewrite:trace3] [pid 3897] mod_rewrite.c(482): [client 141.101.104.182:60012] 141.101.104.182 - - [domain.tld/sid#7f3bd4704a30][rid#7f3bcb27f0a0/initial] [perdir /home/mo45/www/rockstar/weazel/] applying pattern '^([^/]*)/([^/]*)/([^/]*)$' to uri '650/content/madam/rdo_map_nazar_1_sm.jpg'

mod_rewrite enabled, it works on other vhost'Ah. He index.php works without rewritten as intended.

Can't understand what the problem is.

Thanks in advance for your help.
April 3rd 20 at 17:18
1 answer
April 3rd 20 at 17:20
^([^/]*)/([^/]*)/([^/]*)$
Under such a pattern fits the string "650/content/file.jpg" and here "650/content/dir/file.jpg" not anymore.

^(\d+)/(content)/(.+)$
content is also variable.
A little changed the structure and appears to be working.
https://domain.tld/image.jpg/param/size
Variable param passes the URL to the file name. - Zechariah.Fish commented on April 3rd 20 at 17:23

Find more questions by tags ApacheProcessing URL