I've a static website contains html files inside different folders, here's an example about the structure:
index.html
-- folder1
---- folder1.html
-------folderXInsideFolder1
--------- X.html
-- folder2
---- folder2.html
-------folderYInsideFolder2
--------- Y.html
I'd like to redirect the user to the desired .HTML file by the following pattern:
www.website.com --> redirect to index.html
www.website.com/folder1 --> redirect to folder1.html
www.website.com/folder1/X --> redirect to X.html
www.website.com/folder2 --> redirect to folder2.html
www.website.com/folder2/Y --> redirect to Y.html
question from:
https://stackoverflow.com/questions/65644270/nginx-redirect-any-pathname-to-its-subfolder 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…