Ross
Ross

Reputation: 47007

Why is this simple rewriterule failing to function?

I have two rules to redirect to relevant front controllers:

RewriteRule ^api/?.*$ api.php [NC,L]
RewriteRule ^.*$ web.php [NC,L]

Is there a reason why localhost/api/a fails to be caught by the first rule?

Upvotes: 0

Views: 32

Answers (1)

Femi
Femi

Reputation: 64700

Try this:

If its in the root,

RewriteBase /
RewriteRule ^api/?.*$ api.php [NC,L]
RewriteRule ^.*$ web.php [NC,L]

Upvotes: 1

Related Questions