473,473 Members | 4,204 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Jul 17 '05 #1
7 6314
I noticed that Message-ID:
<f2**************************@posting.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 http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
In article <eu********************************@4ax.com>,
Geoff Berrow <bl@ckdog.co.uk.the.cat> wrote:
I noticed that Message-ID:
<f2**************************@posting.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: http://www.iusmentis.com/
Jul 17 '05 #3

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 www.geog.cam.ac.uk/~mvl22
www.lucas-smith.co.uk
Jul 17 '05 #4
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.

http://httpd.apache.org/docs-2.0/mod...directoryindex

--
Jock
Jul 17 '05 #5


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 www.geog.cam.ac.uk/~mvl22
www.lucas-smith.co.uk


Jul 17 '05 #6
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
http://www.narkomanija.ba/

Jul 17 '05 #7
te*******@hotmail.com (Lab309) wrote in message news:<f2**************************@posting.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
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: claudel | last post by:
Hi I have a newb PHP/Javascript question regarding checkbox processing I'm not sure which area it falls into so I crossposted to comp.lang.php and comp.lang.javascript. I'm trying to...
2
by: Tim Fountain | last post by:
We've recently enabled slow query logging on a server and it's proving interesting seeing which queries are bogging things down. This one is puzzling me a little: SELECT articleid, type,...
3
by: claudel | last post by:
Hi I have a newb PHP/Javascript question regarding checkbox processing I'm not sure which area it falls into so I crossposted to comp.lang.php and comp.lang.javascript. I'm trying to...
9
by: Ed_No_Spam_Please_Weber | last post by:
Hello All & Thanks in advance for your help! Background: 1) tblT_Documents is the primary parent transaction table that has 10 fields and about 250,000 rows 2) There are 9 child tables with...
6
by: Umar Farooq | last post by:
Hello all, Please bear with the long explanation of my scenario. As I'm relatively new to the query world, I like to write my queries using the visual toos such as the "View" option in SQL...
7
by: Egor Shipovalov | last post by:
I'm implementing paging through search results using cursors. Is there a better way to know total number of rows under a cursor than running a separate COUNT(*) query? I think PostgreSQL is bound...
1
by: traceable1 | last post by:
I have 2 SQL databases which are the same and are giving me different query plans. select s.* from hlresults h inner join specimens s on s.specimen_tk = h.specimen_tk where s.site_tk = 9 and...
3
by: pbd22 | last post by:
Hi. I need some help with structuring my query strings. I have a form with a search bar and some links. Each link is a search type (such as "community"). The HREF for the link's anchor looks...
12
by: Yash | last post by:
My SQL query is like: SELECT ..... FROM tblCLAIM C INNER join tblXXX .... INNER join tblYYY ....(5 more joins) WHERE C.created_date between @start_date and @end_date AND...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.