Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_URI} ^/talent-hub/(api)
RewriteRule ^api/(.*)$ api/web/$1 [L]

# deal with admin first
RewriteCond %{REQUEST_URI} ^/talent-hub/(admin)
RewriteRule ^admin/(.*)$ backend/web/$1 [L]
RewriteRule ^admin backend/web/$1 [L]

RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ frontend/web/$1 [L] 

#force forward slash

RewriteRule ^[^/]+$ %{REQUEST_URI}/ [L,R=301]