how to manage routing of 2 different angular apps in the same public_html folder

87 Views Asked by At

i have 2 angular apps on the same directory (public_html) one is the main app which has its own routes. and the second is folder inside the main app which also have routes. i have a problem when i want to navigate to a route in the seconds app and when i try that the user returns to the main app.

is there a way to manage this? maybe with htaccess?

enter image description here

1

There are 1 best solutions below

0
Or Shalmayev On

the solution was to put in the second app htaccess with this content:

RewriteEngine On
# For existing assets or directories, no redirection is required
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# if the requested resource doesn't exist, use index.html
RewriteRule ^ ./index.html
RewriteRule ^(.*) /invited/index.html [NC,L]