I understand that my use case is a bit uncommon, but since my site is built using HTML, CSS, and JS, every file I create naturally ends with .html. This makes it a bit confusing when trying to use Pretty URLs.
My Main Concern:
If I use Pretty URLs, I have a few questions:
File Naming:
Should I name my files without the .html extension (e.g., about-us instead of about-us.html)?
If so, how will my code editor handle these files, since most expect .html for syntax highlighting and file type detection?
Internal Linking:
Should my internal links use /about-us instead of /about-us.html even though the actual file is about-us.html?
Will this impact SEO or cause broken links if I’m not careful?
Sitemap and Canonical Tags:
Should I include the .html versions in my sitemap and canonical tags, or should they also be stripped of the .html extension?
I’d appreciate a bit of guidance here, as I want to make sure I’m following best practices for both SEO and site structure.
This isn’t uncommon, it’s how it always works for static sites, even those built with a ‘static site generator’.
No, the files should have a .html extension, e.g. about-us.html
This is a non issue.
Yes, your link in this case would be /about-us
Perhaps, but with web development you always “need to be careful”
For example a worse situation would be just having a broken link.
If you’re really concerned add a canonical tag as mentioned in the thread I linked:
The links without .html extension would be considered the canonical urls.
So you would use them in all places.