1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Find default home page filename of a website?

Discussion in 'Programming' started by Mehdi Jazini, Feb 17, 2014.

  1. #1
    How to find default home page file name of a website?
    SEMrush
    For example: wordpress.com
    I'm not admin of wordpress.com but i want to know what's default home page filename of it?

    default home page file name in my owned website is index.php but i'm not sure what's it, in other websites!

    is any code or api or program to find default home page file name of other websites?

    tnx a lot
     
    Solved! View solution.
    Mehdi Jazini, Feb 17, 2014 IP
    SEMrush
  2. #2
    Depending on how the site is set up, it can be anything.
    Normally, it's either index.html or index.php, since those both "automatically" gets run if you enter an URL.
    However, again, depending on how the site is set up, this might be shown to the user, or not - hence, it's not really possible to figure this out 100%.
    BTW, on wordpress.com, it's index.php ;)
     
    PoPSiCLe, Feb 17, 2014 IP
  3. Mehdi Jazini

    Mehdi Jazini Active Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    63
    #3
    i know what's the default page in wordpress.com ;) that was just an example...
    my problem is winsock.dll in VB6
    in the url argument, i must input something like this: http://www.site.com/index.php
    if i use this http://www.site.com the winsock function can't get html data of the website! :(
    when we open a browser like firefox and input the site.com in it... how can the firefox find the default page in a website !!!!!? i'm sure browser programs use winsock dll ...
     
    Mehdi Jazini, Feb 17, 2014 IP
  4. varindia

    varindia Member

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    38
    #4
    Perhaps the webpage site.com/index.php has not been redirected properly. It will be better to put 301-redirect to that URL.
     
    varindia, Feb 17, 2014 IP
  5. competent123

    competent123 Notable Member

    Messages:
    1,711
    Likes Received:
    66
    Best Answers:
    6
    Trophy Points:
    205
    #5
    its index.php
    index.html
    home.php
    home.html

    in that order

    also, remember that now url's get rewritten by apache, so you may see some other thing in the address bar.

    .htaccess is the first file to be processed by apache, before anything else.
     
    competent123, Feb 17, 2014 IP
  6. Mehdi Jazini

    Mehdi Jazini Active Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    63
    #6
    admins can easily access to the .htaccess file of a website
    anyone know how can non admins (view) the .htaccess file of a website?
     
    Mehdi Jazini, Feb 17, 2014 IP
  7. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,630
    Likes Received:
    722
    Best Answers:
    152
    Trophy Points:
    470
    #7
    Firefox doesn't find the "default" page of anything - it uses what the server provides. Check to see what is being delivered to Firefox - use the webdev plugin, for instance.
    You cannot access a site's .htaccess. You're going about this from the wrong entry-point.
    The site you're trying to reach has some sort of issue or problem, which prevents whatever function you're trying to use via VB6 to not provide the information you need. What that is, I've no idea, since you're not explaining what you're trying to do.
    However, it's NOT needed to provide the actual file for winsock - the site-name should be enough.
     
    PoPSiCLe, Feb 17, 2014 IP
  8. Mehdi Jazini

    Mehdi Jazini Active Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    63
    #8
    do you know winsock?

    Set RemoteFile = New DataConnection
      With RemoteFile
    .
    .
      .FetchURLString "http://yahoo.com" << it can't get html of yahoo.com but if i input something like http://yahoo.com/sample.asp it can work very well
    .
    .
    End With
    Code (markup):
     
    Mehdi Jazini, Feb 17, 2014 IP
  9. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,630
    Likes Received:
    722
    Best Answers:
    152
    Trophy Points:
    470
    #9
    I dunno - I don't know winsock.dll, but as far as I can understand from the documentation I've read today, you're either using the wrong functions, libraries or similar. It's perfectly possible to get the content via the main url only - no need for the actual filename (unless you want to provide certain subpages or similar, of course).
    First - which language are you using, and how do you start the connection?
     
    PoPSiCLe, Feb 17, 2014 IP
  10. Mehdi Jazini

    Mehdi Jazini Active Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    63
    #10
    I'm using Visual Basic 6 (VB6)
    It's a visual basic class written by The KPD-Team, March 13th, 2002
    It seems the KPD-Team die :)))
    I attached the vb project to the post

    I have to search for a new vb component to download HTML of websites from the web :(
     

    Attached Files:

    Mehdi Jazini, Feb 17, 2014 IP
  11. Mehdi Jazini

    Mehdi Jazini Active Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    63
    #11
    Finally I have found the answer... this code working great :)
    anyway thank you for your time

    Private Sub Form_Load()
        Text1.Text = GetHTMLCode("http://yahoo.com")
    End Sub
    Function GetHTMLCode(Optional strURL As String) As String
        Dim objHttp As Object, strText As String
        Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
        objHttp.Open "GET", strURL, False
        objHttp.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0"
        'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
        objHttp.Send ("")
        strText = objHttp.responseText
        Set objHttp = Nothing
        GetHTMLCode = strText
    End Function
    Code (markup):
    Source by http://stackoverflow.com/users/1587402/searas :)
     
    Mehdi Jazini, Feb 17, 2014 IP