• Sorry – I’m a newbie.
    I’ve just ported a site from another host where I had a an htaccess file already working. On the new host I have WordPress installed.

    The ISP automatically added the AddType line “AddType x-httpd-php53 .php” as the first line to my existing .htaccess file. Well and good.. but my WP home page renders as a directory browsing list.

    If I remove all my content from the .htaccess, leaving only the single “AddType x-httpd-php53 .php” line then the page renders properly.

    I have also removed all my rewrite content and left my file handling/cache content in to make sure that it is not a rewrite issue but the problem still persists. Simply put when I have only “AddType x-httpd-php53 .php” in my .htaccess file – everything fine. When my file begins:

    AddType x-httpd-php53 .php
    options +Includes
    
    #compress text, html, javascript, css, xml etc:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/htm
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterbyType DEFLATE image/ico
    AddOutputFilterbyType DEFLATE image/gif
    AddOutputFilterbyType DEFLATE image/jpg
    AddOutputFilterbyType DEFLATE image/jpeg
    AddOutputFilterbyType DEFLATE image/png
    
    # Enable caching headers
    ExpiresActive On
    ExpiresDefault "access plus 4 hours"
    ExpiresByType application/javascript A900
    ExpiresByType application/x-javascript A900
    ExpiresByType text/javascript A2592000
    ExpiresByType text/html M604800
    ExpiresByType text/xml A90
    ExpiresByType text/css A2592000
    ExpiresByType text/plain A2592000
    ExpiresByType image/gif A2592000
    ExpiresByType image/jpg A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/png A2592000
    ExpiresByType image/bmp A2592000
    ExpiresByType application/x-shockwave-flash A3600
    
    # Activate SSI for HTML and or SHTML file types
    AddType text/html .html
    AddType text/html .shtml
    AddHandler server-parsed .html
    AddHandler server-parsed .shtml
    AddHandler server-parsed .htm

    then the directory browsing occurs. Is it something wrong with the order of commands (I have tried placing the php handler with the others).

    thanks for taking the time!

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi kg0279. The line you are referring to:

    AddType x-httpd-php53 .php

    … is telling the server that any file that ends in .php should be handled by php 5.3. Most likely your host has this as they have multiple versions of PHP running on the server, so they are telling your php scripts to run with php version 5.3 (instead of 5.2 for example).

    The following line:

    options +Includes

    … tells the server that if there is no directory index, then to simply list all of the files in the directory.

    Most servers will have index.php set as a file to load by default. It sounds like your server may not have this however. Try adding the following line to your .htaccess:

    DirectoryIndex index.html index.htm index.php

    … this will tell the server to try to load index.html first. If that file does not exist, it should try index.htm. Finally, if index.htm is not here, look for and load index.php if the file exists. It sounds like your server is simply not looking for index.php.

    I hope this helps! Let me know if it doesn’t however.

    Thread Starter kg0279

    (@kg0279)

    Hi Brad,
    thanks for the feedback. I had already checked the server default page entries and index.php was included. However, I included the DirectoryIndex directive that you suggested anyway and there was an effect in that the index.php page was now called but it rendered the source code of the page rather than running script….then I realised I hadn’t cleared the cache!

    The DirectoryIndex worked thanks but I’ll still go back to the ISP about the server setup.

    Best regards

    Kevin

    Hi Kevin, glad to hear you’re making some progress! Be sure to keep us updated, hopefully everything will get sorted out soon if not already.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘htaccess problem – WP not rendering’ is closed to new replies.