Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    the Netherlands
    Posts
    215
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Huh?! How's this possible (Apache+Win98)

    I'm running Win98 with Apache (+PHP4 module + perl +MySQL)

    Lately I noticed the following:
    the file wich is accessed by the URL http://localhost/index.php
    is also accessable on http://localhost/index and also http://localhost/index/as/many/dirs/as/I/want

    Has anyone any idea how this is possible? I'm afraid of security lags that's why I'm asking...

    Thanks in advance
    Mzzl, Chris
    My Website
    010100010011110101110100011011110111000001101000

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    Its the apache 'lookback' feature , which does not I think have a proper name as such ? anyway

    Basically if apache can not find the file it is pointed at it will 'lookback' to the previous part of the url and see if indeed that is a file , so with

    blah.com/index/no_existy

    apache knows that no_existy does not exist so it goes back to index/ which also does not exist as a directory so it checks to see if index.html or index.htm (or whatever your text/html mimes are) to see if one of those exist , if it does it displays it.

    its useful for search-engine friendly urls where you can use this 'feature' to pass info in the URL without using '?' and '&' etc

    blah.com/index/var1/var2

    if index.php exists index.php then has $_SERVER['PATH_INFO']; available which will contain the string '/var1/var2' which can then be used as required.

    Off the top of my head I cant remember which module controls this behaviour though it is possible to disalble it via 'options' in .htaccess or httpd.conf
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    the Netherlands
    Posts
    215
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the advise

    Esspecially the $_SERVER['PATH_INFO']; this answers a question of me that I asked a while ago...

    Thank you

    Mzzl, Chris
    My Website
    010100010011110101110100011011110111000001101000


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •