php extensions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jon Slaughter

    #1

    php extensions

    In most sites that, I guess, use php I don't see them use the php extension.

    For example,



    is search a php script?

    Right now I have things like file.php?someth ing

    and I was wondering if that is ok or if I should look into changing it to
    file?something?

    That is, is there something bad about using the php exention? (or maybe it
    can be turned off or something similar?)

    Thanks,
    Jon


  • John Dunlop

    #2
    Re: php extensions

    Jon Slaughter:
    Right now I have things like file.php?someth ing
    >
    and I was wondering if that is ok or if I should look into changing it to
    file?something?
    You should have looked into that _before_ publishing URLs.
    That is, is there something bad about using the php exention?
    URL "extensions " in general are worse than useless.
    (or maybe it can be turned off or something similar?)
    Look into mod_rewrite or MultiViews.

    --
    Jock

    Comment

    • Schraalhans Keukenmeester

      #3
      Re: php extensions

      On Wed, 02 May 2007 02:53:02 -0500, Jon Slaughter wrote:
      In most sites that, I guess, use php I don't see them use the php extension.
      >
      For example,
      >

      >
      is search a php script?
      >
      IIRC, Google use their own C/C++ based extensions.
      Sh

      Comment

      • Toby A Inkster

        #4
        Re: php extensions

        Jon Slaughter wrote:
        In most sites that, I guess, use php I don't see them use the php extension.
        >
        For example,

        is search a php script?
        No -- Google primarily use C for their search. Some of the newer and less
        data-intensive stuff is written in Python and Java.

        Yahoo, on the other hand, use PHP almost exclusively.
        Right now I have things like file.php?someth ing
        and I was wondering if that is ok or if I should look into changing it to
        file?something?
        Or better yet:

        file/something/
        That is, is there something bad about using the php exention? (or maybe
        it can be turned off or something similar?)
        Firstly, there is the slight security issue. Occasionally, security issues
        are discovered in PHP. If your site includes ".php" in URLs, then it's
        blindingly obvious that you're using PHP, so you become a potential target
        for attack. This generally isn't a huge issue if you keep your copy of PHP
        up to date though.

        More importantly though is the issue of "cool urls". You should start by
        reading Sir Tim Berners-Lee's essay "Cool URLs Don't Change" (you ought to
        be able to find it on Google).

        In particular, a few points:

        1. What if, in 6 months time, you change to using Python? Do
        you want to change all your URLs to ".py", breaking incoming
        links?

        2. Do visitors care that you're using PHP? If not, why should
        they have to write ".php" when they're typing up one of your
        URLs, or speak it if they're reading it over the phone? Keep
        URLs short, and keep unneeded information (such as which
        scripting language you used) out of the URL.

        The general tools you can use to ensure nice URLs are Apache's mod_rewrite
        module, Apache's MultiViews option and PHP's $_SERVER['PATH_INFO']
        variable.

        The mindset you have to get into is: the URLs on my website don't have to
        bear *any* relation to the filenames I use on my server.

        --
        Toby A Inkster BSc (Hons) ARCS
        Fast withdrawal casino UK 2025 – Play now & cash out instantly! Discover the top sites for rapid, secure payouts with no delays.

        Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux

        Comment

        Working...