Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Do you include .html in your internal page links?

Featured Replies

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 on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $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 by Grant Barker

  • 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 by Grant Barker

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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.