简体   繁体   中英

Find the default Page (i.e index.php/default.aspx) for a URL in http Request

I am just wondering if there is a way to find out a sites default page (ie index.php, default.aspx or custom!) automatically through a http request or similar in C#. I have looked in the header response and there doesn't seem to be anything which gives this information.

Any help would be great!

Technically there is no such thing as a default page. Just a page that happens to be in the root directory or that you are directed to when you request the root. It'll certainly not be in a request, because then you would already know. That would be like sending someone a letter to tell them what street they live in. A server might send you a redirect response when you request the root of the website, if so, then you will know what it considers to be it's own 'default page', if not, you'll have to asume its just the root itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM