I don't think this is possible with the two examples you posted since there is no way to "search" for an arbitrary file based on a URL pattern AFAIK, without perhaps using a custom module.
However, if your files were named like the following instead, then it's possible to do this using MultiViews (mod_negotiation):
001.some-sort-of-description.html
002.another-description.html
Note the critical placement of the dots (.
) to create file extension(s).
So, the number 001
is the file basename and some-sort-of-description
and html
are file extensions, then you can use MultiViews (mod_negotiation) to serve the appropriate file by requesting just the numeric portion of the filename.
It's important to end with a "known" file extension (like .html
, .php
or .txt
etc.) that returns an appropriate mime-type. Simply naming the file 001.some-sort-of-description
does not appear to be sufficient.
For this to work, you need to enable the broadest scope of MultiViews matching: Any
. This potentially has security implications so only enable it on the specific directory that contains only your content files.
For example, in the /content/.htaccess
file:
Options +MultiViews
MultiviewsMatch Any
Requesting just /content/001
or /content/002
should then serve the corresponding file. If there are two files with the same "number" then the smallest file is returned.
Reference: