Jump to main content
University Computer Centre
Server Settings - Indication of New Document URL
University Computer Centre 

Server Settings - Indication of New Document URL

Moving a great number of documents to another space results in many URLs changing. The old links (e.g. such found via search engines) will thus point to "the void", the visitor turns away in frustration. With a little trick, you can point them to the new URL without much effort...

In the file .htaccess in the old directory we use the instruction ErrorDocument 404.

Example:
The dir30 directory used to contain many beautiful documents that can now be found under /urz/www. The directory dir30 currently contains only the file index.html. The .htaccess file in the directory dir30 contains:
ErrorDocument 404 /urz/www/auth/examples/dir30/index.html
When accessing an old document in dir30, with index.html you get a document which at least indicates the location of the new document hierarchy.

This procedure has the advantage that search engines recognise the old link as an error (HTTP-Status 404 - Not found) and hopefully delete and record the new one...

Further information: Apache Documentation