Remove # from URL AngularJS
Why Stack Overflow recommends it
Stack Overflow users link it when answering or following along with how to get clean, hash-free URLs in AngularJS routing with html5Mode.
Recommended by 1 people across 1 different months, 2018 to 2020.
What it is
A 4-minute AngularJS tutorial by kudvenkat (Part 27 of his series) showing how to remove the # from URLs. It walks through enabling html5Mode via $locationProvider, removing # from links in index.html, and the related setup steps.
What people said
Recommends Aniket Jha · 2018-02 · Stack Overflow · on “Removing the fragment identifier from AngularJS urls (# symbol)”
Start from index.html remove all # from <a href="#/aboutus">About Us</a> so it must look like <a href="/aboutus">About Us</a> .Now in head tag of index.html write <base href="/"> just after last meta tag . Now in your routing js inject $locationProvider and write $locatonProvider.html5Mode(true); Something Like This:- app.config(function ($routeProvider, $locationProvider) { $routeProvider .when("/home", { templateUrl: "Templates/home.html", controller: "homeController" }) .when("/aboutus",{templateUrl:"Templates/aboutus.html"}) .when("/courses", { templateUrl: "Templates/courses.html", controller: "coursesController" }) .when("/students", { templateUrl: "Templates/students.html", controller
Cites Fatchul Amin · 2018-05 · Stack Overflow · on “How to separate between routing API Sails js and Angularjs”
I build standalone web using node js (Sails) for backend and angularJs for frontend on linux environment and nginx for production mode. I want to remove hash (#!) in my url. I follow this tutorial AngularJS: How to remove #!/ (bang prefix) from URL? [LINK] [this video] Now my website is working properly without hash (#!) in every page as long as I don't refresh, but when I refresh, it call my API from backend or 404 not found. I following those tutorial to put <base href="/"/> on my layout.ejs but it still not work. Here is my sample code for routing angularjs using state (function() { 'use strict'; angular .module('buyer.routes', ['ui.router']) .config(function($locationProvider, $urlMatcherFact
Cites Seniker96 · 2020-08 · Stack Overflow · on “Remove # from URL in ANGULARJS”
I'm new in AngularJS framework. I'm working in Netbeans 8.2, using Glassfish Server. AngularJS version is 1.5.0 I'm trying to remove the # symbol from the URL , with no success until now. So far I've tried: to remove the "#/" from the href links in the index page Add the code in the head section Add the $locationProvider.html5Mode(true) in the script.js file Until now if I do all the 3 steps written above, everytime i try to execute my application for every html page it gives me ERROR 404 - NOT FOUND . For the code I'm following a tutorial on youtube: [this video] this is the link of the video where it removes the # symbol. The main differences are that I'm working with Netbeans and not with Visu