Usually see people use URL http : // a domain name . com Question is : How to find out that site's default page form? example : http : // a domain name . com / index .php or http : // a domain name . com / default .asp or http : // a domain name . com / index .html or http : // a domain name . com / welcome .htm or other name Thanks,
Unless they link to it directly (e.g the 'Home' link), just guess until you find it. Look at other pages on the site and see what format they are (e.g: .php, .asp, .html) For example if all the pages on the site are .php, try index.php and default.php .... You could write a script to do this if necessary, but I don't think there is any other way to do this directly.
Yes, I need the script. Could some one show the script? Is it by checking the site's headers? Thanks,
keep in mind that the default files for a directory can be changed to anything... but generally it won't be.
If you want to know the default url of a site which u dont own then u just have to try all the extensions manually i guess
Here is a simple script in .NET: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim strFiles As String Dim files() As String Dim domain As String strFiles = "index.html,index.htm,default.htm,default.html,index.asp,default.asp,index.aspx,default.aspx,index.php,index.cgi,index.pl" domain = "http://www.google.com/" files = strFiles.Split(",") For Each i In files If CheckURL(domain & i) Then MsgBox(domain & i) : Exit Sub Next MsgBox("Not Found") End Sub Function CheckURL(ByVal strURI As String) As Boolean Dim res As WebResponse Try res = WebRequest.Create(New Uri(strURI)).GetResponse() res.Close() CheckURL = True Catch ex As Exception CheckURL = False End Try End Function Code (markup): Must Import System.Net You can add more file names if necessary...
You could achieve the same result with Classic ASP but would have to use XMLHttp and different error trapping technique.