Zend Framework on Apache 1.3.x

If you are having problems with the .htaccess file for Zend Framework and getting 500 errors, and are running apache 1.3.x (like at GoDaddy), add a slash before index.php in the rewrite rule.

Here is one of my htaccess files for reference


<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType text/html "access plus 1 seconds"
 ExpiresByType image/gif "access plus 2 years"
 ExpiresByType image/jpeg "access plus 2 years"
 ExpiresByType image/png "access plus 2 years"
 ExpiresByType text/css "access plus 2 years"
 ExpiresByType text/javascript "access plus 30 minutes"
 ExpiresByType application/x-javascript "access plus 30 minutes"
</IfModule>

<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 file clientside/css
 mod_gzip_item_include file clientside/javascript
 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>

<IfModule mod_deflate.so>
 SetOutputFilter DEFLATE
 AddOutputFilterByType DEFLATE text/html text/css text/plain application/x-javascript text/javascript
 BrowserMatchSetOutputFilter DEFLATE ^Mozilla/4 gzip-only-text/html
 BrowserMatch ^Mozilla/4\.0[678] no-gzip
 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]

About the Author

I am a software developer/IT professional helping businesses save money through informed purchase consulting; website development and marketing; and process automation.