0👍
As I read the first comment of the question (Here), I understood that I can use this expression of RewriteCond
(Conditioning before Rewriting)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . ./index.html
There are two condtions before rewriting all requests to index.html
file, cheking REQUEST_FILENAME
that makes sure that REQUEST_FILENAME
is not (!
) a file (-f
) or directory (-d
) in the current folder or in one of the subfolders of current folder
Note: Every RewriteCond
before ONE RewriteRule
only effects the same RewriteRule
and does NOT effect any RewriteRule
after that RewriteRule
Source:stackexchange.com