Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other HTACCESS File Do's & Dont's

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #166435
    TWG
    Participant

    I’ve always had a PHP server but I’ve done a majority of my hosting on a Windows box since I work in .NET development for my daytime job and php on my personal site. I’ve never really messed with the HTACCESS file in PHP until recently. I was trying to help a friend out and make his site load quicker so I used the tool from MediaTemple to test the sites load time. After getting the results, I did some searching on Google and it I found to add the following to items to my .htaccess file. Is there anything else I should look into? Anything I should stay away from?

    # BEGIN GZip
    <ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    
    # END GZip
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule>
    ## EXPIRES CACHING ##
Viewing 1 post (of 1 total)
  • The forum ‘Other’ is closed to new topics and replies.