Professional Web Applications Themes

Newb query: index.htm & index.php & the server default - PHP Development

The problem I'm trying to solve is as follows: The website has two subdirectories: /ordinary and /phpstuff. Users typing hostname/ordinary get the file index.htm by default, and this works fine. Users typing hostname/phpstuff don't get anything because there is no index.htm there, only index.php. What can I put in an index.htm file that'll invoke the index.php file? Or is there a setting in the Apache 2.0 server I've overlooked? Win2000; Apache 2.0.43; php 4.3.3; MySQL 4.0.15 --jim...

  1. #1

    Default Newb query: index.htm & index.php & the server default

    The problem I'm trying to solve is as follows:
    The website has two subdirectories: /ordinary and /phpstuff. Users
    typing hostname/ordinary get the file index.htm by default, and this
    works fine. Users typing hostname/phpstuff don't get anything because
    there is no index.htm there, only index.php.
    What can I put in an index.htm file that'll invoke the index.php file?
    Or is there a setting in the Apache 2.0 server I've overlooked?

    Win2000; Apache 2.0.43; php 4.3.3; MySQL 4.0.15
    --jim
    Lab309 Guest

  2. #2

    Default Re: Newb query: index.htm & index.php & the server default

    I noticed that Message-ID:
    <f24abf2c.0309201748.1c896624posting.google.com > from Lab309 contained the
    following:
    >Users typing hostname/phpstuff don't get anything because
    >there is no index.htm there, only index.php.
    index.php works just like index.htm

    --
    Geoff Berrow
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs [url]http://www.ckdog.co.uk/rfdmaker/[/url]
    Geoff Berrow Guest

  3. #3

    Default Re: Newb query: index.htm & index.php & the server default

    In article <eumqmv4at7dfkfteiq107ojv91p52jd2vq4ax.com>,
    Geoff Berrow <blckdog.co.uk.the.cat> wrote:
    >I noticed that Message-ID:
    ><f24abf2c.0309201748.1c896624posting.google.co m> from Lab309 contained the
    >following:
    >
    >>Users typing hostname/phpstuff don't get anything because
    >>there is no index.htm there, only index.php.
    >
    >index.php works just like index.htm
    Only if the server is configured that way. Sometimes you have
    to manually add index.php to the list of default filenames.

    Arnoud

    --
    Arnoud Engelfriet, Dutch patent attorney - Speaking only for myself
    Patents, copyright and IPR explained for techies: [url]http://www.iusmentis.com/[/url]
    Arnoud Galactus Engelfriet Guest

  4. #4

    Default Re: Newb query: index.htm & index.php & the server default




    > The problem I'm trying to solve is as follows: The website has two
    > subdirectories: /ordinary and /phpstuff. Users typing hostname/ordinary
    > get the file index.htm by default, and this works fine. Users typing
    > hostname/phpstuff don't get anything because there is no index.htm
    > there, only index.php. What can I put in an index.htm file that'll
    > invoke the index.php file? Or is there a setting in the Apache 2.0
    > server I've overlooked?
    This is an Apache problem, not a PHP issue. You need to tell Apache to set
    index.php as the default for that directory. The best thing to do would be
    to put in your main .htaccess file:

    DirectoryIndex index.html

    Alternatively, you could consider parsing all .html files for PHP, so that
    you don't constantly have to switch between the two, and change filenames
    [thereby breaking links] every time you decide to add PHP instructions to
    an .html file:

    AddType application/x-httpd-php .html



    Martin Lucas-Smith [url]www.geog.cam.ac.uk/~mvl22[/url]
    [url]www.lucas-smith.co.uk[/url]


    Martin Lucas-Smith Guest

  5. #5

    Default Re: Newb query: index.htm & index.php & the server default

    Martin Lucas-Smith wrote:
    > This is an Apache problem, not a PHP issue. You need to tell Apache to set
    > index.php as the default for that directory. The best thing to do would be
    > to put in your main .htaccess file:
    >
    > DirectoryIndex index.html
    Apache would only search for index.html then -- as it presumably does
    in every stock installation -- and not index.php. DirectoryIndex
    accepts a (space separated) list of resources, thus you can make
    Apache look for index.php by appending it to that list. The first
    resource found is returned.

    [url]http://httpd.apache.org/docs-2.0/mod/mod_dir.html#directoryindex[/url]

    --
    Jock
    John Dunlop Guest

  6. #6

    Default Re: Newb query: index.htm & index.php & the server default



    > > This is an Apache problem, not a PHP issue. You need to tell Apache to
    > > set index.php as the default for that directory. The best thing to do
    > > would be to put in your main .htaccess file:
    > >
    > > DirectoryIndex index.html
    >
    > Apache would only search for index.html then -- as it presumably does in
    > every stock installation -- and not index.php. DirectoryIndex accepts a
    > (space separated) list of resources, thus you can make Apache look for
    > index.php by appending it to that list. The first resource found is
    > returned.
    Sorry, that was a typo - I did mean

    DirectoryIndex index.html index.php

    (This will use index.html if it finds that, if not, index.php, etc.)


    Martin Lucas-Smith [url]www.geog.cam.ac.uk/~mvl22[/url]
    [url]www.lucas-smith.co.uk[/url]




    Martin Lucas-Smith Guest

  7. #7

    Default Re: Newb query: index.htm & index.php & the server default

    Lab309 wrote:
    > The problem I'm trying to solve is as follows:
    > The website has two subdirectories: /ordinary and /phpstuff. Users
    > typing hostname/ordinary get the file index.htm by default, and this
    > works fine. Users typing hostname/phpstuff don't get anything because
    > there is no index.htm there, only index.php.
    > What can I put in an index.htm file that'll invoke the index.php file?
    > Or is there a setting in the Apache 2.0 server I've overlooked?
    you can create .htaccess file with: "DirectoryIndex index.php"

    --
    Avdija A. Ahmedhodzic
    avdija epn ba

    Prevencija putem edukacije
    [url]http://www.narkomanija.ba/[/url]

    Avdija A. Ahmedhodzic Guest

  8. #8

    Default Re: Newb query: index.htm & index.php & the server default

    [email]terphenylhotmail.com[/email] (Lab309) wrote in message news:<f24abf2c.0309201748.1c896624posting.google. com>...
    > The problem I'm trying to solve is as follows:
    > The website has two subdirectories: /ordinary and /phpstuff. Users
    > typing hostname/ordinary get the file index.htm by default, and this
    > works fine. Users typing hostname/phpstuff don't get anything because
    > there is no index.htm there, only index.php.
    > What can I put in an index.htm file that'll invoke the index.php file?
    > Or is there a setting in the Apache 2.0 server I've overlooked?
    >
    > Win2000; Apache 2.0.43; php 4.3.3; MySQL 4.0.15
    > --jim
    Thank you all. I'll modify the Apache file later today.
    --jim
    Lab309 Guest

Similar Threads

  1. Replies: 4
    Last Post: April 9th, 05:53 PM
  2. default index for primary key of a table
    By Greg Stark in forum PostgreSQL / PGSQL
    Replies: 0
    Last Post: December 24th, 08:15 PM
  3. default index created for primary key
    By vinita bansal in forum PostgreSQL / PGSQL
    Replies: 7
    Last Post: December 22nd, 07:30 PM
  4. Replies: 4
    Last Post: August 3rd, 03:11 PM
  5. Replies: 0
    Last Post: October 7th, 02:31 PM

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
  •  

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