Hiding PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rita Harp

    Hiding PHP

    Hi

    I want to hide the php files from my urls.

    My only idea is to have each file in its own directory as a default.php file.

    So instead of this ...

    xxx.com/about.php

    .... rename about.php to default.php and put in a directory /about ...

    xxx.com/about/

    This way I dont need to reference any php files explicitly.


    Is this the best idea in regards to this issue?

    Would appreciate any other ideas/advice!

    thanks
    Rita
  • jack

    #2
    Re: Hiding PHP

    Rita Harp wrote:[color=blue]
    > Hi
    >
    > I want to hide the php files from my urls.[/color]

    Why?
    [color=blue]
    > Is this the best idea in regards to this issue?[/color]

    No. Try apache's mod_rewrite for rewriting URL's into whatever you want.

    --
    --- --- --- --- --- --- ---
    jack@croatiabiz .com


    Comment

    • Kevin Thorpe

      #3
      Re: Hiding PHP

      Rita Harp wrote:[color=blue]
      > Hi
      >
      > I want to hide the php files from my urls.
      >
      > My only idea is to have each file in its own directory as a default.php file.
      >
      > So instead of this ...
      >
      > xxx.com/about.php
      >
      > ... rename about.php to default.php and put in a directory /about ...
      >
      > xxx.com/about/
      >
      > This way I dont need to reference any php files explicitly.
      >
      >
      > Is this the best idea in regards to this issue?
      >
      > Would appreciate any other ideas/advice![/color]

      If you have access to reconfigure the server then tell it to run .html
      files through the php module. No-one will know what you've used then.

      Just watch sessions though. They sometimes add something like
      ?PHPSESSID=xxxx xxxxx to the url. You can change what the session id is
      called to hide that though.

      Comment

      • Dalibor Karlovic

        #4
        Re: Hiding PHP

        Rita Harp wrote:
        [color=blue]
        > I want to hide the php files from my urls.
        >
        > My only idea is to have each file in its own directory as a default.php
        > file.
        >
        > So instead of this ...
        >
        > xxx.com/about.php
        >
        > ... rename about.php to default.php and put in a directory /about ...
        >
        > xxx.com/about/
        >
        > This way I dont need to reference any php files explicitly.
        >
        >
        > Is this the best idea in regards to this issue?[/color]

        This has been talked about few weeks ago, search the group archive on Google
        groups. Keyword: mod_rewrite.

        --
        Dado

        Loose bits sink chips.

        Comment

        • Ian.H

          #5
          Re: Hiding PHP

          On Wed, 24 Sep 2003 02:37:23 -0700, Rita Harp wrote:
          [color=blue]
          > Hi
          >
          > I want to hide the php files from my urls.
          >
          > My only idea is to have each file in its own directory as a default.php
          > file.
          >
          > So instead of this ...
          >
          > xxx.com/about.php
          >
          > ... rename about.php to default.php and put in a directory /about ...
          >
          > xxx.com/about/[/color]



          Apaches' mod_rewrite.



          Regards,

          Ian

          --
          Ian.H [Design & Development]
          digiServ Network - Web solutions
          www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
          Programming, Web design, development & hosting.

          Comment

          • David Zawislak

            #6
            Re: Hiding PHP

            Rita Harp wrote:[color=blue]
            > Hi
            >
            > I want to hide the php files from my urls.
            >
            > My only idea is to have each file in its own directory as a default.php file.
            >
            > So instead of this ...
            >
            > xxx.com/about.php
            >
            > ... rename about.php to default.php and put in a directory /about ...
            >
            > xxx.com/about/
            >
            > This way I dont need to reference any php files explicitly.
            >
            >
            > Is this the best idea in regards to this issue?
            >
            > Would appreciate any other ideas/advice!
            >
            > thanks
            > Rita[/color]
            Name the file index.php.
            HTH

            Comment

            • Patrick Johnson

              #7
              Re: Hiding PHP

              rita_harp@hotma il.com (Rita Harp) wrote in message news:<59fcae49. 0309240037.2baf c594@posting.go ogle.com>...[color=blue]
              > Hi
              >
              > I want to hide the php files from my urls.
              >
              > My only idea is to have each file in its own directory as a default.php file.
              >
              > So instead of this ...
              >
              > xxx.com/about.php
              >
              > ... rename about.php to default.php and put in a directory /about ...
              >
              > xxx.com/about/
              >
              > This way I dont need to reference any php files explicitly.
              >
              >
              > Is this the best idea in regards to this issue?
              >
              > Would appreciate any other ideas/advice!
              >
              > thanks
              > Rita[/color]

              If you're using Apache you could edit your .htaccess file or
              httpd.conf to use ForceType. Your code would look like this:

              <Files about>
              ForceType application/x-httpd-php
              </Files>

              Then you could rename your "about.php" to just "about".

              Comment

              • Tim Tyler

                #8
                Re: Hiding PHP

                Rita Harp <rita_harp@hotm ail.com> wrote or quoted:
                [color=blue]
                > I want to hide the php files from my urls.
                >
                > My only idea is to have each file in its own directory as a default.php file.
                >
                > So instead of this ...
                >
                > xxx.com/about.php
                >
                > ... rename about.php to default.php and put in a directory /about ...
                >
                > xxx.com/about/
                >
                > This way I dont need to reference any php files explicitly.
                >
                > Is this the best idea in regards to this issue?[/color]

                Yes - I believe so.

                This approach encapsulates the server-side technology in use - allowing
                you to switch technologies at a later date without your public interface
                changing.
                --
                __________
                |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

                Comment

                • Luke Ross

                  #9
                  Re: Hiding PHP

                  Hi,

                  Rita Harp wrote:[color=blue]
                  >
                  > I want to hide the php files from my urls.
                  >
                  > My only idea is to have each file in its own directory as a default.php file.
                  >
                  > So instead of this ...
                  >
                  > xxx.com/about.php
                  >
                  > ... rename about.php to default.php and put in a directory /about ...
                  >
                  > xxx.com/about/
                  >
                  > This way I dont need to reference any php files explicitly.
                  >
                  >
                  > Is this the best idea in regards to this issue?
                  >
                  > Would appreciate any other ideas/advice![/color]

                  I personally use MultiViews for this, and then the web server tries
                  various combinations of server-side-language, content-language,
                  content-type and compression levels. Apache guesses which file is most
                  likely to be the required one.



                  Regards,

                  Luke

                  Comment

                  Working...