使用.htaccess重写url时缺少css

  1. this is the first time to me to rewrite url using .htaccess.
  2. when I rewrite the url my css was missing
  3. here is my code:

    RewriteEngine On
    
    RewriteBase /blog/
    
    RewriteCond %{REQUEST_FILENAME} !-d [NC]
    
    RewriteCond %{REQUEST_FILENAME} !-f [NC]
    
    RewriteRule ^([0-9]+)/([^/.]+)/?$ catview.php?ctid=$1&cet_slug=$2 [QSA,L]
    

I need the url: blog/9/iphone

It's working but missing css! Can anyone help me?

You can use following code of .htaccess by which you can acheive your requirement:

not rewrite css, js and images

RewriteCond %{REQUEST_URI} !\.(?:css|js|jpe?g|gif|png)$ [NC]
RewriteRule ^xyz/(.+)/(.+)/ abc.php?id=$1&name=$2 [L]

rewrite css, js and images, from root

RewriteRule ^xyz/[^/]+/[^/]+/(.+)$ $1  [L]