/
通常のファイルまたはディレクトリのタイプに応じて、スラッシュまたは文字列の末尾にドル記号を追加できます$
。パターンを a に移動して、RewriteCond
ディレクトリとファイルを 2 つに分割することもできます
# exclude some directories
RewriteCond %{REQUEST_URI} !^/(div|sitemapXML|cache|AJAX|xml|html|script|cms|style|image|inc|img|templates)/
# exclude some existing files
RewriteCond %{REQUEST_URI} !^/(favicon.ico|robots.txt|index.html)$
RewriteRule ^ index.php [L]
または、@Nielsが想定しているように、既存のすべてのファイルとディレクトリを除外する場合は、次を使用できます
# exclude existing files
RewriteCond %{REQUEST_FILENAME} !-f
# exclude directories
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]