Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Newbie here - please grade my first .htaccess file


handsome_tony - 1:32 am on May 23, 2012 (gmt 0)


Thanks to all for their replies. If someone could simply tell me what the critical issues are and what changes need to be made, that would be great. Once again, this is how my .htaccess looks at the moment:

# disable directory browsing
Options -Indexes

# BEGIN WordPress

RewriteEngine on
RewriteBase /
RewriteCond $1 ^(index\.php)?$ [OR]
RewriteCond $1 \.(gif|jpg|css|js|ico)$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ - [S=1]
RewriteRule . /index.php [L]

# END Wordpress

# Add Proper MIME-Type for Favicon / gzip

AddType image/x-icon .ico
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

# BEGIN Compress text files

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_include mime ^application/javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\\.0[678] no-gzip
BrowserMatch \\bMSIE !no-gzip !gzip-only-text/html

# END Compress text files

# BEGIN Expire headers

ExpiresActive On
ExpiresDefault "access plus 604800 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 1209600 seconds"
ExpiresByType text/javascript "access plus 1209600 seconds"
ExpiresByType application/x-javascript "access plus 1209600 seconds"
ExpiresByType application/javascript "access plus 1209600 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType application/xhtml+xml "access plus 604800 seconds"

# END Expire headers

# BEGIN Cache-Control Headers

<FilesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\\\.(css)$">
Header set Cache-Control "max-age=1209600, public"
</FilesMatch>
<FilesMatch "\.js">
Header set Cache-Control "max-age=1209600, private"
</FilesMatch>
<FilesMatch "\\\\.(x?html?|php)$">
Header set Cache-Control "max-age=604800, no-cache, must-revalidate"
</FilesMatch>

# END Cache-Control Headers

# BEGIN Turn ETags Off

Header append Vary User-Agent
Header unset ETag
FileETag None
Header unset Last-Modified

# END Turn ETags Off


Thread source:: http://www.webmasterworld.com/apache/4454595.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com