Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Preventing Linkrot

I'm reorganizing my site yet again. Every once in a while I decide that something I had lumped in one category deserves a category of it's own. I like organizing by folder, but how do I do it without causing linkrot?

Simple. I copy the old file to the new folder. I give it the keyword "(noindex)" and every loop I write tells it not to pull in files with that keyword.

Then I set the date on the copied file, and change the name of the old file to:

(noindex, for old links only) Old Filename

It will publish as OldFilename, but I know not to update that version.

I'd love to see a placeholder feature so you can create a copy of a file without actually putting a copy there. It won't get index by anything, but will get published.

MarkTAW
Saturday, June 08, 2002

I am solving* this in a slightly different way:
- create missing.html; configure server to redirect 404's to this page.
- in missing.html : javascript; a foreach creates an array of all filenames
- lookup filename. If found, redirect to that page with a note.

Only problem: if the same filename is used several times it may redirect to the wrong page.

Otherwise the site gets too much garbage.

*) am solving, because my provider needs to update the config first... ;-( I won't do the javascript trick though as I want to redirect people to either the main page or the search.

Adriaan van den Brand
Monday, June 10, 2002

I create a filename.html file in the old folder, and in its body I put something like this (< and > replaced with [ and ]):

[html]
[head]
[meta http-equiv="Refresh" content="0;url=PTMFOG0000000028"]
[/head]
[body]
[A href="PTMFOG0000000028"]Document Moved[/A]
[/body]
[/html]

Obviously the magic name is copied from the new file. It's not the prettiest solution, but it works.

If you'd like to see it in action, click on "Darren's Links" over on the left.

BTW Fog Creek people, it would be great if you could one day enhance constants to act like macros, so I could pass the magic name in as a parameter. Then the above code would just become:

{$ .redirect("PTMFOG0000000028") $}

Darren Collins
Monday, June 10, 2002

Err, that should be "Darren's Tips" :-).

Darren Collins
Monday, June 10, 2002

Yeah I was thinking of doing the redirect thing too, but decided against it. Either way there has to be a page there. Besides, Google might like this version better, it'll see the old article and index the new article.

MarkTAW
Thursday, June 13, 2002

OK, I've added an explanation of the redirect technique to my CityDesk tips pages:
http://www.pool-room.com/CodeCraft/CityDesk/Migrating.html

The other way to do it, if you've got access to your server, is to set up server-side redirects. This way, you don't have an extra file lying around in CityDesk. Joel seems to do this.

I also like your method of leaving the old page there, as it gets indexed etc. If I wasn't going to update that version anymore, though, I'd add something near the top of the page saying that the article is out of date and giving the URL to the new version.

Darren Collins
Friday, June 14, 2002

I've actually created a template that looks a lot like yours, but in the meta refresh I put  ="1;{$.body$}".

This way all I'd need to do is put the magic name in the body and I'd be good to go no matter where the new file went.

I yave yet to use it.

MarkTAW
Friday, June 14, 2002

Great idea, Mark! That would definitely make the redirect articles easier to maintain for people who are afraid of html.

Darren Collins
Friday, June 14, 2002

*  Recent Topics

*  Fog Creek Home