title: Beautify URL in Angular JS Works Partially
body: <p>I am fairly new to angular js. To beautify the URL's, I added </p>
  
  <pre><code>$locationProvider.html5Mode(true);
  </code></pre>
  
  <p>in my config file and then</p>
  
  <p>added <code>&lt;base href='/myfolder/'</code>> in the  tag and changed the href links from <code>&lt;a href="#!portfolio"&gt;</code> to <code>&lt;a href="portfolio"&gt;</code></p>
  
  <p>When I run it in the server, what happens is when I click a link from the homepage the URL changes to the link i clicked but only the home page loads again. When I press F5(Refresh). The inner page loads and the URL changes correctly. Again when I press refresh it gives me a 404 error.</p>
  
  <p>Ive explained the steps below.</p>
  
  <p>Step 1</p>
  
  <p><a href="http://localhost/fps-ang/" rel="nofollow noreferrer">http://localhost/fps-ang/</a> (Homepage Loads)</p>
  
  <p>Step2</p>
  
  <p>Clicking portfolio link from the homepage is changing URL to this</p>
  
  <p><a href="http://localhost/fps-ang/#!portfolio" rel="nofollow noreferrer">http://localhost/fps-ang/#!portfolio</a> but again only homepage loads.</p>
  
  <p>Step 3:</p>
  
  <p>Refresh the page and the url is changing to</p>
  
  <p><a href="http://localhost/fps-ang/portfolio" rel="nofollow noreferrer">http://localhost/fps-ang/portfolio</a> The portfolio page loads (which is correct and initially should happen in step 2)</p>
  
  <p>Step 4:</p>
  
  <p>Hitting refresh again is giving 404 error.</p>
  
  <p>Please help. I dont know what im doing wrong here.
  I also tried changing htaccess to this</p>
  
  <pre><code>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 ^ index.html [L]  
  </code></pre>
  
  <p>It did not work. Please help!</p>