Answer the question
In order to leave comments, you need to log in
Apache - mod_rewrite. The regex doesn't work correctly. What is the problem? How to write correctly?
Hello. Didn't work much with apache - mod_rewrite. But now I had to.
The regex doesn't work correctly. For any requests, including /api/blabla/blabla - it returns index.html, but it should be index.php.
Checked here - everything works correctly. But I don't. It seems that the flag [L] does not work. Mb they need to be included somehow?
RewriteEngine on
RewriteRule ^api($|/+.*$) index.php [L]
RewriteRule ^.*$ index.html
Answer the question
In order to leave comments, you need to log in
The solution turned out to be this.
RewriteEngine On
RewriteCond %{ENV:REDIRECT_FINISH} !^$
RewriteRule ^ - [L]
RewriteRule ^api($|/+.*$) index.php [E=FINISH:1,L]
RewriteRule ^.*$ index.html [E=FINISH:1,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question