In my weblibary I have some .tml files, that I would like to be not accessible from the outside - only when requested as .htm pages.
I already use the code below and it works fine.
The code works as follows: If a user asks for example.htm he will get example.tml if it exits. If the example.tml file does not exits we look after the same filename but with the .htm extension and the user will get that file.
What I need is a small piece of code that will tell the user, that if he asks directly for example.tml he will be told that the file does not exits.
When the code is executed, it works fine when I ask for a .tml file - the errorpage is shown. But when I ask for a .htm page that exsists as a .tml page I also get the errorpage - proberly because the code is executed one time more (the .tml file is requested and travels the way down the code - and already gets a hit at line one...)
I have rewritten the code and use it a bit different now.
All the .tml files have been moved to the folder /tml and the code works like this: When a .htm page is requested and not found (no matter the filepath), the page is requested as a .tml file in the folder /tml and shown with the first requested path/adress.