I'm trying to use AngularJs with html5mode enabled, and to be able to use it i need to enable a rewrite i need an .htaccess to point to the folder.
When going to the root index, there is no problem, everything works fine. But when i try to redirect to a subfolder where there is another section, i keep getting errors. For example, i have an admin section to publish news, etc.. So to access this portion of the app i need to go to a subfolder called /adm like this www.site.com/adm and this is where the errors starts.
This is my .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
And this is the errors I'm getting:
Uncaught SyntaxError: Unexpected token <
When looking further, i see this is point to the index on the root. I know it has something to do with the .htaccess file, but i don't how to create a rule to identify if it's a root folder or sub folder and create the proper rewrite rule.
/admalso tried/adm//adm? Should the rewrite work inside that folder? If so, what is the expected result? Yes, right now everything that is not existing file or folder gets rewritten into index.html in root/admit's a new section only for admins, to manage the website. So this subfolder will have it's own index, folders, views, etc.. The rewrite needs to happen on this directory as well (i think) because it also need to have html5mode enabled in order to remove the#from the url.