[jQuery] Don't add ".html" in URL - Please help!!

[jQuery] Don't add ".html" in URL - Please help!!

Hello everybody! Up front, I excuse me for my bad English!

I develop a website and found this fancy animated sidebar-menu: Codyhouse
Furthermore, I specialized on PHP and MySQL, so actually I'm not able to develop jQuery!

But I have a problem! I have the menu like this: 
  1. <nav class="cd-side-navigation">
  2. <ul>
  3. <li>
  4. <a href="#0" class="selected" data-menu="/index.php?site=0">
  5. <svg class="nc-icon outline"><!--SVG ICON STUFF--></svg>
  6. Home
  7. </a>
  8. </li>
  9.             <--! More entries... -->
So in the end, it looks a litte bit like this:  Home

Now I've got the main.css file, which is linked to my HTML-file:
  1. jQuery(document).ready(function($){
  2. //set some variables
  3. var isAnimating = false,
  4. firstLoad = false,
  5. newScaleValue = 1;

  6. //cache DOM elements
  7. var dashboard = $('.cd-side-navigation'),
  8. mainContent = $('.cd-main'),
  9. loadingBar = $('#cd-loading-bar');

  10. //select a new section
  11. dashboard.on('click', 'a', function(event){
  12. event.preventDefault();
  13. var target = $(this),
  14. //detect which section user has chosen
  15. sectionTarget = target.data('menu');
  16. if( !target.hasClass('selected') && !isAnimating ) {
  17. //if user has selected a section different from the one alredy visible - load the new content
  18. triggerAnimation(sectionTarget, true);
  19. }

  20. firstLoad = true;
  21. });

  22. //detect the 'popstate' event - e.g. user clicking the back button
  23.   $(window).on('popstate', function() {
  24.   if( firstLoad ) {
  25.    /*
  26.    Safari emits a popstate event on page load - check if firstLoad is true before animating
  27.    if it's false - the page has just been loaded 
  28.    */
  29.       var newPageArray = location.pathname.split('/'),
  30.        //this is the url of the page to be loaded 
  31.        newPage = newPageArray[newPageArray.length - 1].replace('.html', '');
  32.       if( !isAnimating ) triggerAnimation(newPage, false);
  33.    }
  34.    firstLoad = true;
  35. });

  36.   //scroll to content if user clicks the .cd-scroll icon
  37. mainContent.on('click', '.cd-scroll', function(event){
  38. event.preventDefault();
  39. var scrollId = $(this.hash);
  40. $(scrollId).velocity('scroll', { container: $(".cd-section") }, 200);
  41. });

  42. //start animation
  43. function triggerAnimation(newSection, bool) {
  44. isAnimating =  true;
  45. newSection = ( newSection == '' ) ? 'index' : newSection;
  46. //update dashboard
  47. dashboard.find('*[data-menu="'+newSection+'"]').addClass('selected').parent('li').siblings('li').children('.selected').removeClass('selected');
  48. //trigger loading bar animation
  49. initializeLoadingBar(newSection);
  50. //load new content
  51. loadNewContent(newSection, bool);
  52. }

  53. function initializeLoadingBar(section) {
  54. var selectedItem =  dashboard.find('.selected'),
  55. barHeight = selectedItem.outerHeight(),
  56. barTop = selectedItem.offset().top,
  57. windowHeight = $(window).height(),
  58. maxOffset = ( barTop + barHeight/2 > windowHeight/2 ) ? barTop : windowHeight- barTop - barHeight,
  59. scaleValue = ((2*maxOffset+barHeight)/barHeight).toFixed(3)/1 + 0.001;
  60. //place the loading bar next to the selected dashboard element
  61. loadingBar.data('scale', scaleValue).css({
  62.    height: barHeight,
  63.    top: barTop
  64. }).attr('class', '').addClass('loading '+section);
  65. }

  66. function loadNewContent(newSection, bool) {
  67. setTimeout(function(){
  68. //animate loading bar
  69. loadingBarAnimation();
  70. //create a new section element and insert it into the DOM
  71. var section = $('<section class="cd-section overflow-hidden '+newSection+'"></section>').appendTo(mainContent);
  72. //load the new content from the proper html file
  73. section.load(newSection+'.html .cd-section > *', function(event){
  74. //finish up the animation and then make the new section visible
  75. var scaleMax = loadingBar.data('scale');
  76. loadingBar.velocity('stop').velocity({
  77. scaleY: scaleMax
  78. }, 400, function(){
  79. //add the .visible class to the new section element -> it will cover the old one
  80. section.prev('.visible').removeClass('visible').end().addClass('visible').on('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){
  81. resetAfterAnimation(section);
  82. });

  83. //if browser doesn't support transition
  84. if( $('.no-csstransitions').length > 0 ) {
  85. resetAfterAnimation(section);
  86. }

  87. var url = newSection+'.html';

  88. if(url!=window.location && bool){
  89.        //add the new page to the window.history
  90.        //if the new page was triggered by a 'popstate' event, don't add it
  91.        window.history.pushState({path: url},'',url);
  92.    }
  93. });
  94. });

  95. }, 50);
  96. }

  97. function loadingBarAnimation() {
  98. var scaleMax = loadingBar.data('scale');
  99. if( newScaleValue + 1 < scaleMax) {
  100. newScaleValue = newScaleValue + 1;
  101. } else if ( newScaleValue + 0.5 < scaleMax ) {
  102. newScaleValue = newScaleValue + 0.5;
  103. }
  104. loadingBar.velocity({
  105. scaleY: newScaleValue
  106. }, 100, loadingBarAnimation);
  107. }

  108. function resetAfterAnimation(newSection) {
  109. //once the new section animation is over, remove the old section and make the new one scrollable
  110. newSection.removeClass('overflow-hidden').prev('.cd-section').remove();
  111. isAnimating =  false;
  112. //reset your loading bar
  113. resetLoadingBar();
  114. }

  115. function resetLoadingBar() {
  116. loadingBar.removeClass('loading').velocity({
  117. scaleY: 1
  118. }, 1);
  119. }
  120. });
I don't know why and I don't get the clue. And all together results in this when I want to go to another page: 


How can I remove ".html" at the end of the url? 


Please help me. You'll be welcome!
Your sincerely, Nicolas.