.htaccess doesn't rewrite /something to index.php?menu=something. It shows something.htm instead
===

I want my site to treat URI as part of a query string. When accessing properly with sub.domain.cz/something it works okay. If I don't use neither www nor sub, it rewrites URL and works. But when I use www, it rewrites www.domain.cz to sub.domain.cz, but it shows sub.domain.cz/something.htm instead of threating 'something' like parameter. I thought there is the problem with miltiple use, but adding Options -MultiViews didn't change anything (and removing !-f makes it lose connection to styles). 

    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^(www\.)?domain\.cz$ [NC]
    RewriteRule ^(.*)$ http://sub.domain.cz/$1 [L,R=301]
    
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteCond %{REQUEST_URI} !=style.css
    RewriteRule ^(.*)$ index.php?menu=$1 [L,QSA]


I'm not any expert. Mostly I'm just trying a bunch of stuff I find on Internet and simultaneously trying to understand them for future use. But now I have no idea of what's wrong. I've tried changing order and flags. Maybe all of that changed something but it was not visible to me. Do you have any nice idea, please?