When splitting a folder with tens of thousands of documents into several folders, how can I handle broken links?

by jcmaad   Last Updated February 20, 2019 15:04 PM

I have over 30,000 html files stored in www.example.com/docs, and these files contain are linked to each other. When it comes to displaying the content of those files on my site, I use the following code: HTML Include using Java

I learned today that my host allows a maximum of 10,000 files per folder. This means that I have start splitting up my files into different folders. I will probably create a number of folders like

  • www.example.com/docs1
  • www.example.com/docs2
  • www.example.com/docs3

This causes an issue because I have to amend the hyperlinks within all 30,000 files, and I have to update the URLs within pages that display documents within those folder.

I don't mind creating the folders and moving the files, but I am really dreading updating the links and URLs. Is there a solution I can leverage? I am thinking something .htaaccess related, but I am not knowledgeable enough.

Related Questions

Updated June 29, 2016 08:01 AM

Updated November 28, 2017 17:04 PM

Updated November 30, 2017 05:04 AM

Updated August 29, 2017 10:04 AM