Main menu

SmartFeed by FeedBurner Subscribe to the site feed.


If you find the information here useful, then please consider a small donation, or linking to this site.

Recent Comments

Recent Tweets

  • @wilhil Try Dorset... at least in London you expect drivers to do stupid things...
  • Just stumbled on http://www.wherestheanykey.co.uk/ - some funny cartoons on there :-) Kind of reminds me of the BOFH series...
  • @GuySmithFerrier Thanks for that Guy... interesting stuff!
  • RT @JayOatway: Email is back: The Three Key Elements of Irresistible Email Subject Lines - http://bit.ly/cD5ZQH
  • @GuySmithFerrier Is that for UK? I could see using film stills being Fair Use in the US, but we don't have a notion of Fair Use over here...

Calendar

December 2004
M T W T F S S
« Nov   Jan »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Archive

Archive for December 8th, 2004

Using .htaccess to improve the user experience for a website running on an Apache server

A few weeks back, I updated two websites (which run on my ISPs’ Apache servers) to use various features which improve the experience for users of the site. These features include:

Server side includes (SSI).
Changing the default web page.
Providing custom error messages.
Redirecting clients where pages have changed.
Preventing listing the contents of certain directories.
Denying access to certain [...]

Using server side includes in web pages

One of the features used in my website is server side includes (SSI). The SSI code allows my sites to include dynamic information which would otherwise require scripting that may not function correctly with certain browsers.
SSI is pretty simple. Apache users need to edit the .htaccess file in their web root directory to allow SSI, [...]

Implementing custom error pages for a website

One of the features used in my website is custom error pages, which allow errors to be handled using a format that matches other documents on the site.
Apache users can configure custom error messages using .htaccess. Once pages have been created for an error message, include a directive in the .htaccess file as follows:
ErrorDocument error-code [...]

Changing the default documents for a website

My ISPs’ Apache servers are configured for index.html and index.htm to be the default documents; however since implementing server side includes in my websites I need index.shtml to be recognised as the default document.
Fortunately, this can be achieved using the following directive in the corresponding .htaccess file:
DirectoryIndex index.shtml index.html index.htm
Microsoft Internet Information Server (IIS) users [...]

Redirecting clients when websites change

Whilst looking at the website statistics for my main website, I realised that many users were attempting to access pages that no longer exist on the server. Some may argue that old content should be left in place, but others will disagree and my preferred approach is to redirect requests to the new locations, or [...]

Preventing listing the contents of a directory on an Apache web server

When no default document is found on a web server, depending on the server configuration, users may be able to list the files in a given directory. For Apache servers, this may be prevented on a per-directory basis by adding add an IndexIgnore directive to an .htaccess file.
The syntax is:
IndexIgnore file [file] ...
For example, IndexIgnore [...]

Denying access to certain files on an Apache web server

Under certain circumstances, it may be necessary to deny users access to various files on a web server.
For example, some directives in an Apache .htaccess file may be considered a security risk and so access to the file may be prevented using the following directives:
<files .htaccess>
order deny,allow
deny from all
</files>
The first line limits the directive to [...]