Home
Support Forums

The .html is missing from the end of the urls, this is affecting the site because it is loading the incorrect nav bar

Hi! My site: jwebb.netlify.app, that I am coding for a client, is being loaded incorrectly. It loads the homepage correctly, but when I then when I use the nav-bar to travel around the site, it doesn’t load the new pages correctly. I misses out the .html aspect of code, and is therefore not loading in some aspects. If I manually type in the correct url, then everything loads fine.
The issue that I have noticed is the look of the navbar, if you check the incorrect build: jwebb.netlify.app/about-us, compaired to: jwebb.netlify.app/about-us.html, then you will see the difference.
I am using manual builds, not git, in case that is of some importance.
Many Thanks

Hey Lloyd!

What browser are you using? When I navigate with or without the .HTML the navbar highlights the active nav blue, I assume this is the behaviour you’re saying isn’t working?
The only navigation that doesn’t highlight blue is the “Choose an expert” but it also doesn’t highlight blue if I use .html either.

Are you using netlify pretty URL?

I would imagine that you’d rather remove the page file extensions altogether anyways and always show without?

To do that you could use netlify redirects like this in a _redirects file at the root directory. This means that even if you type the .html it will show it without and you don’t have to code specifically for a match with it included. I hope that makes sense?

/*              /index.html     200
/about-us/*        /about-us.html     200
/report-range/*      /report-range.html   200

@LloydDevelops I’m not seeing this issue. The .html suffix is on the links, the pages are loading, and the menu highlight is working.

I did notice that both your canonical and scheme URLs are incorrect, though. “index.html” is not correct. You need the full URL in these fields. This has nothing to do with the issue you’re reporting, but I thought I’d mention it.

@gregraven,

, this image shows the issue.
If the navigation bar is working for you, then I am very confused

Ah, I have sorted it! The file names were capitalised, and that prevented them from loading.
Thanks for all of your help.