My folder structure looks like this:
/.htaccess
/admin
/admin/api
/admin/admin
index.html (Angular JS app)
So I need to do the following rewrites:
- Serve
/admin/admin
at/admin
- Serve
/admin/api/*
at/admin/api/*
(no rewrite) - Serve
/{everything else}
fromindex.html
How can I do this in the root .htaccess?
So far, I've got:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</IfModule>
But this doesn't handle the rewriting of /admin/admin
to /admin
. Can anyone help with this?
You can use:
This is assuming there is no .htaccess inside
/admin/
folder. In case there is then use this rule there: