Hello... You say Rewrit is already activated in the AAPanel. I can tell you that Modrewrit is not activated! Otherwise we wouldn't have these problems.
As usual, it is enough to enter the command (a2enmod rewrite) in the SSH terminal, then systemctl restart apache2 and the rewrite starts. I think you will initially agree with me. My installation script tells me that no rewrite is activated. Problem is: when I execute the Rewrite command in Terminal then the message Rewrite activated comes up with the message Systemctl restart apache2 to run - However, no Systemctl restart apache2 can be found in the terminal or, according to the system, no Apache2 is installed. Understandably because aapanel uses a different configuration. It would be helpful if you could activate the command or publish better answers that even a beginner could get started with. The answers in the forum on the topic of rewriting were better against questions than answers.