School of Computing. Dublin City University.
Online coding site: Ancient Brain
Here are various different approaches to this:
|User||Relationship between URL and file system||What happens if case wrong||Example of correct case||Example of incorrect case|
|Sysadmins||Indirect. Content management system. URL seems to be address of an object in its database.||Content management system can implement its own case-insensitive addressing.||Correct||Incorrect|
|Normal user's personal webspace||Direct||404 Not Found||Correct||Incorrect|
|My personal webspace||Direct||404 triggered, but I re-direct the error to my own 404 PHP handler program to do case-insensitive and partial matching.||Correct||Incorrect|
This page explains how to make a 404 PHP handler.
Put a .htaccess file in:
This .htaccess file has a line to redirect 404 to a program:$HOME/public_html/.htaccess
ErrorDocument 404 /~myuserid/404.php
ErrorDocument 404 /~myuserid/404.php ErrorDocument 403 /~myuserid/404.php
This works for my sub-site only:
It won't work for mis-spellings higher up: