Reputation: 537
I'm trying to remove '#' from urls.
Using link with ui-sref or href attributes navigation works properly, but accessing directly to the same url, or refreshing page or pressing enter into url bar of the browser i get 404 not found error.
I enabled html5 mode:
$locationProvider.html5Mode(true);
Added base tag in head before any inclusion:
<base href="/folder/" />
Here is .htaccess file content (copied from angular-ui faq):
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ /folder/index.html [L]
Seems to be a problem related to .htaccess file.
What is wrong?
Upvotes: 2
Views: 400
Reputation: 537
I've to:
a2enmod rewrite
service apache2 restart
Upvotes: 1