LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   No php for DirectoryIndex? (http://www.linuxquestions.org/questions/linux-server-73/no-php-for-directoryindex-506292/)

subnet_rx 11-30-2006 02:00 PM

No php for DirectoryIndex?
 
My server guys are telling me that because our site resides in site root (/var/www/html/), that they cannot automatically setup the domain to go to index.php, it has to be index.html and then redirect to index.php. Is this true?

Server runs on Redhat AS 3 and Apache 1.3

derxob 11-30-2006 02:02 PM

I dont think it is true. They should be able to add a line like: "AddType application/x-httpd-php .php" to the httpd.conf

subnet_rx 11-30-2006 02:10 PM

Well it runs php files just fine. And the only place that redirect is required(according to them) is the home page. I have installed several php scripts with no problem. Apparently, every time they delete the index.html in the site root, it reverts to an AS default page or something and won't go to index.php. Here is the DirectoryIndex line from httpd.conf

<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.phtml index.cgi
</IfModule>

derxob 11-30-2006 02:26 PM

Oops. I meant to say DirectoryIndex index.htm index.php in my last post, not the AddType line. Looks like you already have that though.

Try adding a .htaccess file in your root directory that has the line
"Options +Indexes" in it. See what happens..

subnet_rx 11-30-2006 02:29 PM

Well, this is a production server for a corporate website. Doing something and seeing what happens isn't an option. I have to know before going in that this will work. I've just never heard of having to redirect to a php page because Apache will only direct to index.html.

derxob 11-30-2006 02:31 PM

Adding Options +Indexes to .htaccess might work. Its not dangerous. Try it.

Also check out http://www.linuxquestions.org/questi...d.php?t=460362 - this guy had a similar problem and it was due to his profile in firefox, not apache.


All times are GMT -5. The time now is 04:18 PM.