www.webdeveloper.com
Results 1 to 4 of 4

Thread: Strange URL Behaviour

  1. #1
    Join Date
    Feb 2011
    Location
    Waterloo, Ontario, Canada
    Posts
    80

    Strange URL Behaviour

    I'm wondering how sites these days are managing their content and AJAX calls.

    How is it that Facebook is able to have a URL like:
    http://www.facebook.com/zuck

    without with / on the end of zuck like
    http://www.facebook.com/zuck/

    This is obviously really handy as they don't actually need to create a sub-directory called zuck.

    I noticed as well that places like http://hypem.com/popular is doing it too. Convenient for them as they're able to run their media player without breaks and they don't need to to have a # in their URL.

  2. #2
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    865
    In all honesty I can't say I know a whole lot about what those specific sites are doing and how their system is setup and designed to work.

    Obviously you can leave the trailing slash in a URL of a folder off and it will still load, but as a redirect (which is slower) and typically you'll see the slash added once the request has succeeded. But other than that, a URL with no trailing slash typically means it'd be pointing to a file rather than a folder. But that doesn't mean you can just go take extensions off your pages because they'll load as plain text in a browser rather than a webpage.

    I've heard of .htaccess 'tricks' that can redirect to index pages without adding a trailing slash but I don't really know much about that. Other than those few things I can't really tell you much. Obviously avoiding the use/need of sub-directories is a better way to go and so perhaps there is some 'trick' to getting a file (lacking an extension) to somehow redirect or load content which would give the desired result.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  3. #3
    Join Date
    Nov 2012
    Posts
    15
    It's all about the .htaccess

    Try redirecting to the URL you want...then you should get that result.

  4. #4
    Join Date
    Oct 2012
    Posts
    55
    I would have to think the end bit is not a link "zuck", probably just a unique identifier parsed from the string then retrieved from a database.

    Not sure about Ajax but PHP and Python do this sort of thing with ease.



    Dan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles