I am trying to remove hash tag from my website. I have achieved it by following code.
$locationProvider.html5Mode(true);
As well as added b
In order to support reloading of HTML5 mode route URLs, you need to implement server-side URL rewriting to direct non-file requests (that is, requests that aren't explicitly for an existing file) to your index file, typically index.html
.
From the documentation
Using this mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html).
Your rewrite rule should not have any #
in the destination URL. Instead, use this
RewriteEngine on
# Don't rewrite files
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.php [L]
Source ~ https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode
Also, there's no need to set RewriteBase
.