Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

What is the file name of default web page

Hi

Looking to find out what is the filename e.g. index.php  when you make a request to a website that you are not managing e.g. www.experts-exchange.com by making a request to the website

Any ideas please preferably in .net c#

Rgds
stephen
0
stephenwilde
Asked:
stephenwilde
  • 3
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
The default page is definable in the web server setup.  Common variations include 'index.htm', 'index.html', 'index.php', 'index.jsp', 'default.htm', and 'default.asp'.  You can define it to be any filename you want though if you want to use an odd extension name, you may have to define a 'handler' for it so the web server knows what to do with it.  If all you have is the domain URL like "http://www.yoursite.com/", there is no way to tell what the default page is set to.  Most of the time it will start with 'index'.
0
 
stephenwildeAuthor Commented:
Thanks

But I think out there somewhere may the solution.
I currently make a call from .net using WebClient client = new WebClient();
to get the html of the page but I need to know what the file name is of that index/default page it is comming from?
0
 
Miguel OzSoftware EngineerCommented:
Check:
http://stackoverflow.com/questions/690587/using-webclient-in-c-sharp-is-there-a-way-to-get-the-url-of-a-site-after-being-r

The solution is valid even with redirections. The property ResponseUri contains the required value.
0
 
stephenwildeAuthor Commented:
Thanks for info but when I ran the code it came back with a url on property ResponseUri namely http:\\mysite.com not what I was looking for which would have been more like default.aspx
0
 
stephenwildeAuthor Commented:
Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now