How to make it so that a site on laravel would be available on the example.com address, and an Angula application would be loaded on example.com/admin? Server structure

root -laravel (сайт на laravel) -admin (приложение на angular) 

I tried it like this, it does not work

 <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*)$ laravel/public/$1 [L] RewriteRule ^/admin/$ /admin/app/index.html$1 [L] </IfModule> 

    1 answer 1

    Add another route to Laravel and give index.html .

    Or correct the rules. You have two problems there:

    1. The first rule overlaps the second
    2. Apache2 doesn’t like slash at the beginning (before admin)

    It will turn out like this:

     ... RewriteRule ^admin/$ /admin/app/index.html$1 [L] RewriteRule ^(.*)$ laravel/public/$1 [L] ... 

    Or so:

     ... RewriteRule ^/?admin/$ /admin/app/index.html$1 [L] RewriteRule ^(.*)$ laravel/public/$1 [L] ... 

    A few links: