如果服务器上不存在来自链接的文件,则强制.htaccess加载index.php

I create some MVC site in PHP

using this in .htaccess:

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

but if i want to add css file like

<link rel="stylesheet" href="file.css" type="text/css" charset="utf-8"/>

i have 404 error : there is no controller like file.css

Is there any possibility to force .htaccess to load index.php if file from link doesn't exists on server ?

You can use:

# Not for real file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]