Page URL Extension

I have noticed that a page url is working no matter what extensions you use ie.
/index
/index/
/index.htm
/index.htm/
/index.html
/index.html/
Is this the case with all urls? As Treepl doesn’t allow for .htm or .html extensions for pages, is this the work around so that pages can be accessed via any of these options in the browser?

1 Like

Yes, that’s my understanding. It’s also why it’s important to set the canonical URL on the SEO tab because search engines can access pages from all the URLs. Also .htm will work. I didn’t realise the I could trail a / on URLs.

All this is also a consideration when migrating sites and doing url redirects.

Only issue here @Alex_B_Centrifuge is that the redirect doesn’t work. If I put a redirect from index.htm to / it still shows index.htm in the browser address.

You mean if you forward /directory/index.html to /directory/ you don’t see /directory/ in the Brower bar?

The only way to have /directory/ show in the browser bar is to put the content ‘in’ the folder by clicking on the edit(pencil icon) next to the folder.

As an example I want to redirect /index.htm to / (the old url was /index.htm but the new one is /index) but it still shows /index.htm in the browser window when this redirect is applied.

Is this an index page within a directory or the root site?
If the root site level, you’d set this page as the “Home Page” wouldn’t you?

So I was curious and did some tests.

If I put the content “on” the folder, so the url of the content is /test-folder/ . I can create a url redirect that goes from /test-folder/index (note no extension) to /test-folder/ and it does redirect /test-folder/index.htm, /test-folder/index.html, /test-folder/index to /test-folder/ and shows the desired content.

I didn’t know about putting content “on” the folder until somebody specifically pointed it out to me. Maybe it’s something you already know, but if you click the edit (pencil) icon next to the folder, you can add content to it like you would a page.

@Alex_B_Centrifuge just one word of caution - you cannot “index” the /folder in the sitemap.xml file. They have purposely ‘turned off’ the ability to have the folder indexed in the sitemap file. I was using this method for one my clients and thought I was brilliant to have found this out, only to find out that it wasn’t actually being included in my sitemap.xml file, so I had to manually create my sitemap.xml using Screaming Frog.

@Adam.Wilson as an example, I have a site that just went live that had a homepage of /index.htm. Now that the new url has been setup as /index, I want to be able to redirect the url to “/” but when you add this as a redirect it still just shows /index.htm in the browser address.