Tagged: .htaccess

Creating Custom Error Messages in Apache

Creating Custom Error Messages in Apache

Introduction The .htaccess file is a file found in Apache servers that allows you to manipulate the behaviour of the server. A very common use is to create custom error messages for server errors. Examples of such errors are “404 Not Found” (say when you...

How to Prevent Apache HTTPD Directory Listing using .htaccess

How to Prevent Apache HTTPD Directory Listing using .htaccess

Apache HTTPD servers are configured by default to display directory listing, when index files like index.htm or index.html of index.php etc. are not present in the directory. This can expose sensitive information to prying eyes and are often indexed by search engines. This can compromise...

Forcing www (or no-www) in domain name

Forcing www (or no-www) in domain name

One of the first things I do when I begin implementing a site is to force the www (or no-www) in the domain name. Why would I want to do this? For search engine optimization of course. For example, naseerahmad.com redirects to www.naseerahmad.com. What this...