I have an Angular project and I want to deploy it on a specific folder (not root) so something like this : http://localhost/folder/index.html So i need to redirect all requests on this path without changing URL.
The following works fine when the index.html is at root (so, http://localhost/index.html) :
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
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
So I tried to change this code like this to work with my project :
RewriteRule ^ /folder/index.html
I works fine with this request : http://localhost/folder/abcd but not with http://localhost/folder/abcd/efgh, http://localhost/folder/abcd/efgh/.../..../.....
Thank you for your help!