A Responsive Blogger Website, That Take my blog to the next level.

I am a Software Developer, Learning and experementing with .Net Technology and try to put my Learning altogether here.

We have all sections related to .Net Technology, like .Net-C#, Asp.Net, MVC, jQuery, AngularJs, Sharepoint. Find out more...

Following are the some of the Advantages of using this Web site :-

  • Get Update about latest in .Net world.
  • Collection of Useful, Frequently used .Net Solutions.
  • It’s beautiful on every screen size (try resizing your browser!)

Remove # from URL AngularJS

Chandan Kumar
shared this article with you. 

Remove # from URL AngularJS

There are 4 simple steps to remove # from URLs in Angular.
Step 1 : Enable html5mode routing. To do this inject $locationProvider into config() function in script.js and call html5Mode() method passing true as the argument value. With this change the config function will now look as shown below.
.config(< span>function ($routeProvider, $locationProvider) {
        .when("/home", {
            templateUrl: "Templates/home.html",
            controller: "homeController"
        .when("/courses", {
            templateUrl: "Templates/courses.html",
            controller: "coursesController"
        .when("/students", {
            templateUrl: "Templates/students.html",
            controller: "studentsController"

Step 2 : In index.html, remove # symbols from all the links. The links in index.html should look as shown below.
<a href="home">Home</a>
<a href="courses">Courses</a>
<a href="students">Students</a>

Step 3 : Include the following URL rewrite rule in web.config. This rewrite rule, rewrites all urls to index.html, except if the request is for a file, or a directory or a Web API request.
      <rule name="RewriteRules" stopProcessing="true">
        <match url=".*" />
        <conditions logicalGrouping="MatchAll">
          <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
        <action type="Rewrite" url="/index.html" />

Step 4 : Set the base href to the location of your single page application. In the head section of index.html include the following line.
<base href="/" />

Inoreader is a light and fast RSS Reader. Follow us on Twitter and Facebook.