Posts Under 'httpd'

How to enable GZIP Compression in Apache Server to Speed up Website

Compression is a simple and effective way to speed up your site. Modern browsers supports gzip compressed content and are capable of uncompressing gzip data into plain text. The gzip module configuration depends on your Apache Server version: Apache 1.3 uses mod_gzip while Apache 2.x uses mod_deflate. mod_gzip configuration for Apache 1.3.x:

Read more »


How to Add – Remove the WWW Prefix from Domain Name Using .htaccess

To avoid duplicate content problem with search engines, you have to redirect all pages to one common URL. This you can achieve using mod_rewrite of apache and .htaccess. To redirect any URL starting with www.domain.tld to domain.tld, you have to add the following code to .htaccess file. Do a 301 redirect for all http requests […]

Read more »


Directory index forbidden by Options directive

I was going through error log and saw this error in error log file. To solve this problem, In /etc/httpd/conf.d you will see a file entitled welcome.conf It looks like this: <LocationMatch “^/+$”> Options -Indexes ErrorDocument 403 /error/noindex.html </LocationMatch> Change it to this: <LocationMatch “^/+$”> Options Indexes ErrorDocument 403 /error/noindex.html </LocationMatch> Just remove the hyppen(-) […]

Read more »


Creating Custom Error Messages in Apache

Below is an example of a httpd.conf file, just copy and paste into your file, but change the paths: ErrorDocument 404 /path/to/your/error/file/or/scriptErrorDocument 500 /path/to/your/error/file/or/scriptErrorDocument 403 /path/to/your/error/file/or/script A very important point to note is that the paths should be the relative paths. This means that the paths would be what you would type on the machine […]

Read more »


Redirecting subdomains to directories in apache.

If you want to be able to redirect blah.domain.com to domain.com/blah/ so that blah.domain.com is shown in the address bar here’s a quick and dirty how to: First off if you want any subdomain to be able to be redirected first you need to set-up your DNS correctly. In my case this was as simple […]

Read more »