The cleanest way to link between these pages is to use URLs relative to your document root. See Absolute vs relative URLs for more information, but starting each URL with / (making your URLs relative to the document root) will help a lot.
So to link to your article1.html page from anywhere else, use /A/article1.html as the href value, and similarly to link to your homepage from anywhere else, you can use /index.html. Using the URLs relative to the document root makes linking between pages a lot cleaner than relative to the current path (./A/article1.html, ./article1.html, article1.html, ../index.html, etc). See https://stackoverflow.com/a/21828923/1499877 for additional examples, which also links to additional resources.
Problem :
I have different pages for my website and I have put those HTML files in a folder X and inside there are index.html, main.html, etc and there are more different pages for different articles. Now that I have separated those articles in different folders A, B, C for easy access inside folder X but now my index.html, main.html etc files are not linking to the article pages. And not even article files are linking to each other.
Look at image for a better understanding of my problem.