You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Julien OIX <ju...@presidence.univ-nantes.fr> on 2002/01/14 13:37:44 UTC

DirectoryIndex directive ...

hi everyone,

this directive is mysterious for me ...

I have a test virtualHost to understand this directive:

<VirtualHost 193.52.112.79>

Port 80
ServerName toto.presidence.univ-nantes.fr
ServerAdmin root@miles.presidence.univ-nantes.fr
DocumentRoot /var/www/html
ErrorLog logs/error_log
DirectoryIndex index.html index.htm

<Directory /var/www/html>
	Options All
	Order allow,deny
	Allow from all
</Directory>
</VirtualHost>

I have index.html and index.htm under /var/www/html and when I change
the order of files in the DirectoryIndex directive, it doesn't change
anything when I try the URL http://toto.presidence.univ-nantes.fr, it
always redirects to index.htm.

Be sure I've read the manual and questionned the bug database ...

Can anyone confirm me that this directive is used when the URL ends with
a "/" and telles apache to look for a filename in the DocumentRoot
directory, such as index.html or index.htm in my case ?

Maybe some other directives can influence the process ?

Has anyone a tip ?

thanks in advance.

-- 
Julien OIX
Service Informatique de Gestion
Tél: 02 40 99 83 65
mail: julien.oix@presidence.univ-nantes.fr

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: DirectoryIndex directive ...

Posted by Julien OIX <ju...@presidence.univ-nantes.fr>.
hi everyone,

Joshua Slive a écrit :
> 
> > From: oix@av9500.presidence.univ-nantes.fr
> > [mailto:oix@av9500.presidence.univ-nantes.fr]On Behalf Of Julien OIX
> 
> > > When you say that http://x.x.x.x "gives" http://myhost/index.jps, do you
> > > mean it simply serves that content, or do you mean that it
> > redirects to that
> > > new location (causing the URL bar in your browser to change)?
> >
> > on the apache server itself, it redirects (the URL bar changes)
> 
> Well, Apache doesn't do that in any standard configuration.  So there must
> be something you're not telling us about: either some
> Redirect/RewriteRule/ErrorDocument in httpd.conf or some funky refesh in
> your page itself, or some other machine in the way.

In order that you verify, I join my httpd.conf ...
> 
> Please give us the real URL to this page.  I can't help any more with fake
> names.

the IP is 193.52.112.79 (DNS can't be updated at this moment, so my
apache server can be reached only by IP)

and the home page should be http://193.52.112.79/index.jsp

thanks

-- 
Julien OIX
Service Informatique de Gestion
Tél: 02 40 99 83 65
mail: julien.oix@presidence.univ-nantes.fr

RE: DirectoryIndex directive ...

Posted by Joshua Slive <jo...@slive.ca>.
> From: oix@av9500.presidence.univ-nantes.fr
> [mailto:oix@av9500.presidence.univ-nantes.fr]On Behalf Of Julien OIX

> > When you say that http://x.x.x.x "gives" http://myhost/index.jps, do you
> > mean it simply serves that content, or do you mean that it
> redirects to that
> > new location (causing the URL bar in your browser to change)?
>
> on the apache server itself, it redirects (the URL bar changes)

Well, Apache doesn't do that in any standard configuration.  So there must
be something you're not telling us about: either some
Redirect/RewriteRule/ErrorDocument in httpd.conf or some funky refesh in
your page itself, or some other machine in the way.

Please give us the real URL to this page.  I can't help any more with fake
names.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: DirectoryIndex directive ...

Posted by Julien OIX <ju...@presidence.univ-nantes.fr>.
hi joshua and everyone,

Joshua Slive a écrit :

> > the most surprising is that it works fine when the client browser is on
> > the apache server itself (http://x.x.x.x gives http://myhost/index.jsp)
> > but from an other machine of the same domain , http://x.x.x.x/index.jsp
> > works fine and  http://x.x.x.x OR http://x.x.x.x/ doesn't give
> > http://x.x.x.x/index.jsp
> >
> 
> When you say that http://x.x.x.x "gives" http://myhost/index.jps, do you
> mean it simply serves that content, or do you mean that it redirects to that
> new location (causing the URL bar in your browser to change)?

on the apache server itself, it redirects (the URL bar changes)

> 
> My best guess at this point is that your browsers are caching some older
> version of your site before you changed the configuration.  Try from a
> computer you have never used before.

Even from a "new" machine, i have the same problem ...
 
> Just to clarify, DirectoryIndex is the proper method to set the default file
> that will be served when a directory is requested.

so, this is the directive I need to serve http://x.x.x.x/index.jsp when
a client tries http://x.x.x.x ?

> Joshua.
> 
the DNS for my domain can't be updated for the moment, that's why I have
IP-based VH and I try URL with IP's; with that, can I exclude the DNS
problem to explain this one ?

thanks

-- 
Julien OIX
Service Informatique de Gestion
Tél: 02 40 99 83 65
mail: julien.oix@presidence.univ-nantes.fr

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: DirectoryIndex directive ...

Posted by Joshua Slive <jo...@slive.ca>.
> From: oix@av9500.presidence.univ-nantes.fr

> the most surprising is that it works fine when the client browser is on
> the apache server itself (http://x.x.x.x gives http://myhost/index.jsp)
> but from an other machine of the same domain , http://x.x.x.x/index.jsp
> works fine and  http://x.x.x.x OR http://x.x.x.x/ doesn't give
> http://x.x.x.x/index.jsp
>

When you say that http://x.x.x.x "gives" http://myhost/index.jps, do you
mean it simply serves that content, or do you mean that it redirects to that
new location (causing the URL bar in your browser to change)?

My best guess at this point is that your browsers are caching some older
version of your site before you changed the configuration.  Try from a
computer you have never used before.

Just to clarify, DirectoryIndex is the proper method to set the default file
that will be served when a directory is requested.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: DirectoryIndex directive ...

Posted by Julien OIX <ju...@presidence.univ-nantes.fr>.
Joshua Slive a écrit :
> 
> > From: oix@av9500.presidence.univ-nantes.fr
> > [mailto:oix@av9500.presidence.univ-nantes.fr]On Behalf Of Julien OIX
> 
> > I have index.html and index.htm under /var/www/html and when I change
> > the order of files in the DirectoryIndex directive, it doesn't change
> > anything when I try the URL http://toto.presidence.univ-nantes.fr, it
> > always redirects to index.htm.
> 
> >From this and your previous questions, it sounds like you have a Redirect or
> RerwiteRule someplace in httpd.conf that is doing this redirecting.
> DirectoryIndex will not cause a redirect; it simply serves the file.  So if
> you are accessing http://yourhost/ and seeing http://yourhost/index.htm in
> the URL bar, then this is not caused by DirectoryIndex.
> 
> Joshua.
> 

hi joshua and others,

I had a look to my httpd.conf and be sure there is neither Redirect or
RewriteRule directive; what you answer to me troubles me; if I have VH
(myhost for example) and in order to serve http://myhost/index.jsp when
client accessing http://myhost OR http://myhost/, may I use
DirectoryIndex or an other directive ?

the most surprising is that it works fine when the client browser is on
the apache server itself (http://x.x.x.x gives http://myhost/index.jsp)
but from an other machine of the same domain , http://x.x.x.x/index.jsp
works fine and  http://x.x.x.x OR http://x.x.x.x/ doesn't give
http://x.x.x.x/index.jsp

moreover by accessing with IP's, DNS issues have no influence ...

thanks

-- 
Julien OIX
Service Informatique de Gestion
Tél: 02 40 99 83 65
mail: julien.oix@presidence.univ-nantes.fr

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: DirectoryIndex directive ...

Posted by Joshua Slive <jo...@slive.ca>.
> From: oix@av9500.presidence.univ-nantes.fr
> [mailto:oix@av9500.presidence.univ-nantes.fr]On Behalf Of Julien OIX

> I have index.html and index.htm under /var/www/html and when I change
> the order of files in the DirectoryIndex directive, it doesn't change
> anything when I try the URL http://toto.presidence.univ-nantes.fr, it
> always redirects to index.htm.

>From this and your previous questions, it sounds like you have a Redirect or
RerwiteRule someplace in httpd.conf that is doing this redirecting.
DirectoryIndex will not cause a redirect; it simply serves the file.  So if
you are accessing http://yourhost/ and seeing http://yourhost/index.htm in
the URL bar, then this is not caused by DirectoryIndex.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org