Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: weird index.love??

  1. #11
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey View Post
    I repeat, the request URI passed to the server needn't be the path to an actual file. It can be whatever the server wants it to be. For example, in Django, there's an urls.py file which contains a list of regexes and functions (all in one file, views.py) to associate with them. When the regex is matched in a request URI, the function is called with the regex's captures as arguments, and the result of the function is displayed to the browser.
    Just out of curiosity then, under those circumstances, what is displayed in the address bar? Is it the user entered/link URI or the URI of the resource/page fetched?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No, you're looking it in completely the wrong way.

    When a request is sent to the server, the URI line looks something like this:
    Code:
    GET /path/to/file.html HTTP/1.1
    That "/path/to/file.html" is just a string. It's entirely up to the webserver what to do with it. It may decide to use that to look for a file called file.php on the server's hard drive, or it may do something totally different; it might, for example, connect to a remote site and download some data from there, or run a script, or contact a device (a webcam or some such thing).

    The browser's address bar shows the URL of the current location. Unless a redirect status code is returned, that doesn't change. The real data, though, can come from anywhere: there's no guarantee that the URL reflects the layout of the server's hard drive, or even that the webserver is reading from the hard drive at all.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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