The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Server downloading indexes file

Discussion in 'General Discussion' started by omenix, Oct 10, 2006.

  1. omenix

    omenix Active Member

    Joined:
    Aug 24, 2005
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    /dev/null
    My server is keep downloading index files instead of displaying it. Any help ?

    I already add this line in httpd.conf

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps

    and the DirectoryIndex index.php

    But still the server seems to be downloading instead of displaying it.. any other method?
    something like editing the php.ini ?
     
  2. omenix

    omenix Active Member

    Joined:
    Aug 24, 2005
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    /dev/null
    Oh btw.. its working fine when using IE but not using firefox .. firefox only working when I use http://domain.com instead of using http://www.domain.com .. any suggestion would be great. Thank you.
     
  3. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    If you are downloading .php files instead of being parsed and rendered then your php engine is not running and parsing the pages so it delivers the file instead. You may want to check that your php directives are not commented out in httpd.conf as well as looking over your php.ini file for errors.

    what does this command render?
    httpd configtest
    php -v

    As for your www and http addresses, that is most likely a .htaccess configuration problem. Check your root directory and look at the .htaccess file
     
  4. omenix

    omenix Active Member

    Joined:
    Aug 24, 2005
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    /dev/null
    # php -v
    PHP 4.4.2 (cli) (built: Oct 10 2006 13:30:19)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    /etc/init.d/httpd configtest
    Syntax OK

    I will check the .htaccess and also is there anything I should edit on php.ini? since I already replace the php.ini-recommended to /usr/local/lib/php.ini


    Heres the .htaccess for the current site

    Heres the .htaccess for the current site

    #good'ol rewrite
    RewriteEngine on
    RewriteBase /

    # bot-protect
    # RewriteCond %{HTTP_USER_AGENT} ^$ [NC]
    # RewriteRule !robots\.txt|favicon\.ico - [F,L]

    # rates to pricing migration 2006-04-13
    RewriteRule ^rates/(.*)$ http://www.domain.com/pricing/$1 [R=301,L]

    # clients area ssl only
    RewriteCond %{SERVER_PORT} !443
    RewriteCond %{REQUEST_URI} ^/clients/([^/]+)$ [NC]
    RewriteRule ^(.*)$ https://www.domain.com/$1/ [R,L]

    RewriteCond %{SERVER_PORT} !443
    RewriteCond %{REQUEST_URI} ^/clients/.*$ [NC,OR]
    RewriteCond %{REQUEST_URI} ^/contact(/|/.*)$ [NC]
    RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L]

    RewriteCond %{SERVER_PORT} 443
    RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
    RewriteCond %{HTTP_HOST} !^(www\.l|l)www.domain.com$ [NC]
    RewriteCond %{REQUEST_URI} !^/clients/.*$ [NC]
    RewriteCond %{REQUEST_URI} !^/contac(t/|t).*$ [NC]
    RewriteCond %{REQUEST_URI} !^/reader.php [NC]
    RewriteRule ^(.*(\.(html|htm|cgi)|/))$ http://www.domain.com/$1 [R,L]

    RewriteCond %{SERVER_PORT} 443
    RewriteCond %{REQUEST_URI} ^/clients//$ [NC]
    RewriteRule ^.*$ http://www.domain.com/ [R,L]

    RewriteCond %{SERVER_PORT} 443
    RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC,OR]
    RewriteCond %{HTTP_HOST} ^(www\.l|l)www.domain.com$ [NC]
    # RewriteCond %{REQUEST_URI} !^/www.domain.com/.*$
    RewriteRule ^(.*(\.(html|htm|cgi|php)|/))$ www.domain.com/$1 [R,L]


    # disable subdirs in client-upload dir
    RewriteCond %{REQUEST_URI} /clients/.*$ [NC]
    RewriteCond %{REQUEST_URI} /clients/.*/dir/.*$ [NC]
    RewriteCond %{REQUEST_URI} /dir/.*/.*$ [NC]
    RewriteRule ^.*$ - [F,L]

    # disable .htaccess in client-upload dir
    RewriteCond %{REQUEST_URI} /clients/.*$ [NC]
    RewriteCond %{REQUEST_URI} /clients/(.*)/dir(.*)$ [NC]
    RewriteCond /home/user/public_html/clients/%1/dir/.htaccess -f
    RewriteRule ^.*$ - [F,L]

    # disbale /www.domain.com blog
    RewriteRule ^www.domain.com(.*)$ /reader.php?file=error404.html [L,NC]

    # reader mapping
    RewriteRule ^(.*\.(html|htm|cgi))$ /reader.php?file=$1 [L,QSA,NC]

    RewriteCond %{REQUEST_URI} !/admin2/.* [NC]
    RewriteRule ^(.*/)$ /reader.php?file=$1 [L,QSA,NC]

    RewriteCond %{REQUEST_URI} !/clients/.*/ [NC]
    RewriteCond %{REQUEST_URI} !/testtlk.php$ [NC]
    RewriteCond %{REQUEST_URI} !/reader.php [OR,NC]
    RewriteCond %{REQUEST_URI} /clients/.*/$ [NC]
    RewriteCond %{REQUEST_URI} !/admin2/.* [NC]
    RewriteRule ^(.*\.(php))$ /reader.php?file=$1 [L,QSA,NC]

    <Files 403.shtml>
    order allow,deny
    allow from all
    </Files>
     
  5. omenix

    omenix Active Member

    Joined:
    Aug 24, 2005
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    /dev/null
    Anyone can help me fix this issue?
     
  6. anushkumar

    anushkumar Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    What does your register globals say? did you do any updates lately?

    nothing wrong with your htaccess. This seems like an issue with your php. Since it works with IE and not with the other browsers, probably a reboot might fix.
     
Loading...

Share This Page