witam

mam problem z htaccess

chcę skonfigurować aplikacje tak by :

wchodząc pod adres http://localhost - pojawiała się storna frontend
wchodząc pod adres http://localhost/backend - pojawiała się storna backend
wchodząc pod adres http://localhost/api - pojawiała się storna api

Struktura katalogów wygląda następująco
Kod
Frontend
    |-web
        |-index.php
backend
    |-web
        |-index.php
api
    |-web
        |-index.php

.htaccess



VirualHosta w apache skonfigurowałem tak by kierował do głównego katalogu aplikacji

i tam umieściłem taki .htaccess

Kod
RewriteEngine On

# End the processing, if a rewrite already occurred
RewriteRule ^(frontend|backend|api)/web/ - [L]

# Handle the case of backend, skip ([S=1]) the following rule, if current matched
RewriteRule ^backend(/(.*))?$ backend/web/$2 [S=1]
RewriteRule ^api(/(.*))?$ api/web/$2 [S=1]

# handle the case of frontend
RewriteRule .* frontend/web/$0

# Uncomment the following, if you want speaking URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+/web)/.*$ $1/index.php


niestety w takim przypadku strona backend nie działa

jesli zablokuje

Kod
#RewriteRule ^api(/(.*))?$ api/web/$2 [S=1]


backend zacznie działać

jak w takim razie powinna wyglądać reguła dla api ?