Resolve links to submodule files

This is probably best explained with an example. The Adminer project tracks third party designs, which is now incorporating submodules as they are much simpler and more efficient than a forked repository. The theme files that are not (yet) submodules are accessible via the URLs like:

https://raw.githubusercontent.com/vrana/adminer/master/designs/galkaev/adminer.css

Those in submodules currently 404 if one attempts to access them by their old/expected URL like:

https://raw.githubusercontent.com/vrana/adminer/master/designs/pepa-linha-dark/adminer.css

They are only accessible via their own repo’s URL structure like:

https://raw.githubusercontent.com/pepa-linha/Adminer-Design-Dark/81eb3c48708b0132977d63a1948920cc1cefdefa/adminer.css

It would make accessing the files clean, consistent, and easy, and preserve public URLs when subdirs are later converted to submodules.

Other examples of this are collection-type repositories, such as Noah’s vim themes.

I’m afraid this is not possible, since the URL pointing to a submodule file is not correctly resolved by GitHub due to redirection to the original repository.

The “preserve public URLs when subdirs are later converted to submodules” part is problematic, looks like you’ll have to set up your own URL redirection system. I’m not aware of any public service offering URL redirections which can later on be updated — there are obvious safety concerns, because a link turned popular could suddenly be redirected to a malicious site.

If you have a running server somewhere that you can use for this, you might either setup a CGI script somewhere to handle redirections based on whether the URL includes a submoduled folder or not, or rely on some .htaccess file and mod rewrite rules.