TCM
UoC crest

Redirecting an old Home Page to a TCM Profile

Some will wish to retain their home pages as being more flexible, and capable of spanning multiple pages. Others may feel that their profile page suffices. To redirect a home page, such as http://www.tcm.phy.cam.ac.uk/~spqr1/ to a profile such as http://www.tcm.phy.cam.ac.uk/profiles/spqr1 the recipe is very simple.

One simply needs to create in one's ~/public_html directory a file named .htaccess (note the leading dot, which means that it will be hidden from ls unless the -a option is given), with the contents:

redirectMatch 301 ^/~spqr1/$ http://www.tcm.phy.cam.ac.uk/profiles/spqr1

The "301" means that the redirection is permanent (and cacheable). For short-term experiments, use "302" instead. Then follows the URL to redirect (without the server name, but with the anchors ^ at the start, and $ at the end), and the full URL (including server name) to which to redirect.

Of course the same recipe will enable you to redirect your TCM home page to a page hosted elsewhere, perhaps particularly useful if you leave. If you leave off the anchors, you can redirect a whole site. So without them

http://www.tcm.phy.cam.ac.uk/~spqr1/research.html
would get rewritten to the nonsense
http://www.tcm.phy.cam.ac.uk/profiles/spqr1research.html