P粉7637488062023-09-01 09:04:12
When I read the first comment of the question (here), I understood that I could use this expression of RewriteCond
(conditional handling before rewriting)
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . ./index.html
Before rewriting all requests to the index.html
file, there are two conditions, check REQUEST_FILENAME
to make sure REQUEST_FILENAME
is not (REQUEST_FILENAME
>!) A file (-f
) or directory (-d
)
Note: ONE RewriteRule
Each preceding RewriteCond
only affects the same RewriteRule
and will not Affects any RewriteRule
that follows RewriteRule