September 16, 20179 yr I stopped including.html in my links some time ago. A little script in the htaccess file helps with that. However, in doing so I probably broke access to my site visitor stats page which was showing up as 403 forbidden. I ignored that for some months and didn't care about it. Yesterday, I asked my site support to fix access to that page, which they quickly did. Unfortunately their fix seemed to make every linked page on my site 404. I think they removed my custom htaccess file which was simply in the root folder, and used their own simpler htaccess file in the comm folder. Reversing the situation completely gave me back access to my pages, but the visitor stats page is 403 again (obviously). The confusing thing is that the tech (on live chat) said that their specialist said that I can't have urls without .html, but that if I add the following to the htaccess it should fix all of the problems if I include .html in the urls: RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME}\.html -fRewriteRule ^(.*)$ $1.html I tested it, but it didn't seem to work. I thought I had been doing things correctly seeing as the site was working fine. So, as per the topic title, do you include .html in your url page links (when writing code)? If you think you are interested, I can paste the htaccess file I'm using, and the one that they preferred to use (which killed all of my internal links (403)). I don't mind writing .html in my code if that's necessary. I simply don't want .html to appear in the browser or when hovering over links. It's no big deal, but it would be nice to fix the visitor stats page and keep the site as is, if I'm not doing anything wrong. Just in case you have any thoughts, please chime in. I hope you are all well, and thanks. I've mostly neglected the site for a quite a few months, but would like to keep things ticking over. Edited September 16, 20179 yr by Grant Barker
September 16, 20179 yr If it's a html page why wouldn't you include this in the link URL? If it's not an html page then it doesn't need including.
September 16, 20179 yr Author If it's a html page why wouldn't you include this in the link URL? If it's not an html page then it doesn't need including. When I look at the source of many sites, there are lots of examples of links where they don't have the .html in the link. eg. href='site.com/thispage' (Are these just Wordpress sites or something?) And I also have been doing this for quite a while now. (My site is not a Wordpress site - just your standard.) Is this completely wrong? Or can it only be done if the page is inside a folder as opposed to the root or something? ie. href='site.com/thissection/' If you check out the source page of my sig, is that completely wrong to omit .html in all of the hrefs? Edited September 17, 20179 yr by Grant Barker
September 17, 20178 yr There is no extension on many sites because the pages are all compiled from a database. The actual page doesn't exist. It's not wrong to omit the .html on your site - it's just not necessary. It doesn't win you any brownie points with users or Google.
September 17, 20178 yr Author There is no extension on many sites because the pages are all compiled from a database. The actual page doesn't exist. It's not wrong to omit the .html on your site - it's just not necessary. It doesn't win you any brownie points with users or Google. OK. Great. Thanks fisicx. Originally I just wanted to lose the extension in the browser as it seemed old fashioned to have it. As for brownie points, they would be nice to have, but I gave up on that stuff, hence why I removed all Social Media buttons, etc.
Create an account or sign in to comment