Advanced Search

Results 1 to 7 of 7

Thread: pretty URL

  1. #1
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default pretty URL

    does anyone know how they got rid of the ".php" in this url

    http://www.createthegroup.com/en/who...o=JamesGardner
    Last edited by ggalan; 01-21-2011 at 01:14 AM.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    262
    Thanked 690 Times in 678 Posts

    Default

    It's the index file, so you just access it by typing the name of the directory:

    site.com/directory/
    site.com/directory/index.php

    Those go to the same place.

    And for both you can add a query string using the ? symbol.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    but how can you hide the "index.php" when you add the query?
    if you placed it
    Code:
    index.php?var=foo
    then the "index.php" would be visible

  4. #4
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Well, one way is:

    Code:
    www.website.com/?var=hello
    That hides that it's the index, the other method is doing it with htaccess.

  5. #5
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    so something like this?
    and inside a folder called 'somefolder' you would have a "index.php"
    Code:
    <a href='somefolder/?var=hello '></a>

  6. #6
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,627
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    yup..
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  7. The Following User Says Thank You to traq For This Useful Post:

    ggalan (01-21-2011)

  8. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    262
    Thanked 690 Times in 678 Posts

    Default

    In other words, "index.php" and similar default filenames* can always be omitted from URLs and everything that goes before AND everything that goes after remains as it was. Mathematically: X+index.php+Y = X+Y.


    (*php, html, asp and other "html" filetypes, named index.ext, home.ext, default.ext, and perhaps more, depending on your server configuration. I've never known of a server where index isn't the default like that.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. The Following User Says Thank You to djr33 For This Useful Post:

    ggalan (01-21-2011)

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
  •