Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default 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
    Rita Harp Guest

  2. Similar Questions and Discussions

    1. hiding css layer
      is it possible to only show a layer based on a cookie? if so how? also is it possible to time a css layer so that it hides automatically after a...
    2. Hiding Forms
      I am trying to hide one of two forms on asp/vbscript page based on the parameters received from the previous page ... any sample code or thoughts?
    3. hiding errors
      Hello, I use a PHP script to count the visitors of my website.. When the access to the mysql database does not work (provider problems), i...
    4. Hiding the link
      Does somebody knows how to hide the link for a web page??? something like this I have a webside in http://localhost i have the default.html...
    5. Hiding a URL ?? is this possible ??
      I have several pages on a server which I need to show, but keep the URL private. Is there a way to put a link on my site, and hide the URL? Also,...
  3. #2

    Default Re: Hiding PHP

    Rita Harp wrote:
    > 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?
    This has been talked about few weeks ago, search the group archive on Google
    groups. Keyword: mod_rewrite.

    --
    Dado

    Loose bits sink chips.
    Dalibor Karlovic Guest

  4. #3

    Default Re: Hiding PHP

    Rita Harp wrote:
    > Hi
    >
    > I want to hide the php files from my urls.
    Why?
    > Is this the best idea in regards to this issue?
    No. Try apache's mod_rewrite for rewriting URL's into whatever you want.

    --
    --- --- --- --- --- --- ---
    [email]jack@croatiabiz.com[/email]


    jack Guest

  5. #4

    Default Re: Hiding PHP

    Rita Harp wrote:
    > 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!
    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=xxxxxxxxx to the url. You can change what the session id is
    called to hide that though.

    Kevin Thorpe Guest

  6. #5

    Default Re: Hiding PHP

    Rita Harp wrote:
    > 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
    Name the file index.php.
    HTH

    David Zawislak Guest

  7. #6

    Default Re: Hiding PHP

    [email]rita_harp@hotmail.com[/email] (Rita Harp) wrote in message news:<59fcae49.0309240037.2bafc594@posting.google. com>...
    > 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
    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".
    Patrick Johnson Guest

  8. #7

    Default Re: Hiding PHP

    Rita Harp <rita_harp@hotmail.com> wrote or quoted:
    > 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?
    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 [url]http://timtyler.org/[/url] [email]tim@tt1lock.org[/email] Remove lock to reply.
    Tim Tyler Guest

  9. #8

    Default Re: Hiding PHP

    Hi,

    Rita Harp wrote:
    >
    > 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!
    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.

    [url]http://httpd.apache.org/docs/content-negotiation.html[/url]

    Regards,

    Luke

    Luke Ross Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139