LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-19-2009, 09:43 PM   #1
xshad0wfx
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Rep: Reputation: 0
(CentOS 5.3 server) httpd.conf configuration issue involving DirectoryIndex


im almost positive the issue is isolated with the httpd.conf, however i could be completely off. The issue involves links in my server and the DirectIndex file is being read. For example if you go to www.example.com/index and /index is not a directory but index.php i get a server error saying /index does not exists. but if i type in the url www.example.com/index.php it works fine. so im asking what the correct configuration for my server should be so /index can be read and not return a "Not found" error.
 
Old 06-19-2009, 09:54 PM   #2
jhcaiced
Member
 
Registered: Mar 2009
Distribution: CentOS - Ubuntu - Debian
Posts: 83

Rep: Reputation: 27
Hi,

As I understand, if your request is
http://www.example.com/index apache searches for a directory
named 'index' and a file called index.html or index.php inside
that directory, using the DirectoryIndex directive to find
the file.

It could be wrong to add 'index' to DirectoryIndex because
without an extension, apache cannot determine the handler
to use, and a file named 'index' without extension will
be confusing so i don't see the point in having a file
called index when it should be easier to call it index.html

If you really need to have a 'index' member in your url then
maybe a rewrite rule or something like that can be
implemented, but again, i don't see the point.
 
Old 06-19-2009, 09:57 PM   #3
xshad0wfx
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Original Poster
Rep: Reputation: 0
thanks for your advice, the reason i asked on how to do this was because of a script/template im actually using to host my website, and i thought it'd be easier to just configure the httpd.conf instead of the actual script/template and hunt for the links. But thanks again.
 
Old 06-19-2009, 10:10 PM   #4
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Try and entry like
Code:
DirectoryIndex index.php index.html index.htm index.shtml
but you shouldn't need the /index anyway (ie just www.example.com)

Edit - in fact, putting /index will probably break anything, since you are really telling apache to look for www.example.com/index/index.html or similar.

Last edited by billymayday; 06-19-2009 at 10:12 PM.
 
Old 06-19-2009, 10:32 PM   #5
xshad0wfx
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Original Poster
Rep: Reputation: 0
After looking at the script i realize that i cant edit the php files to direct the links to .php extensions because its trying to read /videos for example (which in the html folder is videos.php) as a file that can read and write directories. the best example i can show with the issue im dealing with is this ex: http://www.example.com/video/829/my-cool-video. (video) is actually video.php running a script directing the link you clicked to directory 829 where there's a video that is named 1.flv but that's masked in the browser. I know for a fact a configuration in my server is wrong because its reading everything as a directory and not as potential scripts. I have a feeling that there might be a mistake in the configuration of my php as well.

Last edited by xshad0wfx; 06-19-2009 at 10:34 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie / dummy httpd.conf issue leicaphotos Linux - Newbie 6 10-03-2008 09:54 AM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
httpd.conf configuration Ameii83 Linux - General 1 06-07-2006 01:24 AM
HTTPD configuration issue rblampain Linux - General 4 08-14-2005 12:19 AM
configuration of httpd.conf to run apache server adityabhat2 Linux - Newbie 2 02-13-2005 12:10 PM


All times are GMT -5. The time now is 07:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration