Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Forward old URLs when article renamed or moved

(I apologize if I already commented on this before elsewhere, I actually cannot remember.)

The problem:

I just moved a bunch of articles into a new folder, and this changed the URL of each article, so instantly all my search engine hits hit my 404 page.

The suggestion:

CD should automatically created a forwarding page from the old URLs to the new URLs, to save the hits.

I realize this type of thing only happens in the early stages of creating a web site.  (Afterall, the articles should have been in the proper place right off the bat.)  But, it *does* still happen, and it would be a cool feature to have to save your web site if you ever have to move or rename articles in the future.

Tell me what you think!

www.MatthewDoucette.com
Friday, July 23, 2004

You could do the very thing you suggested yourself,  to forward to the new articles locations from the old location, the articles in the old location would contain the forwarding meta http-equiv.

Ron Lane
Friday, July 23, 2004

I have done this manually for one article (is this what you meant?)  But, I would like a feature that does this automatically as it is quite time consuming.

www.MatthewDoucette.com
Friday, July 23, 2004

I created a redirect template with a meta refresh in the header that takes it's values from the article fields.  Something like...
<META HTTP-EQUIV=Refresh CONTENT="{$ .author $}; URL=http://www.noferrets.com/{$ .headline $}">

and in the body...
<h3> The page you requested has been moved. The new url is <a href="{$ .headline $}">http://www.noferrets.com/{$ .headline $}</a> You will be taken there in {$ .author $} seconds.</h3>

When you move a page create a new one at the old url, set it use the redirect template and put the new url in the headline and the desired delay in the author field.  Easy and quick. 

However if you're technically inclined and hosted on Apache you really should look into using mod_alias or mod_rewite to handle this kind of thing at the server. Perhaps ISS has a similar facility as well.

Ken McKinney
Friday, July 23, 2004

That is quicker, but it still takes time if you moved *every* article on the site as I did! :(

I can do server-side redirects, but this is something I feel CityDesk should handle.  What happens if you forget that the file was moved?  Or if you change the articles title slightly, without thinking of the consequences, and then the URL is old because the filename is renamed too.

It already has to delete the old html files (it knows of them), so it could easily just modify them instead.

CityDesk would then need a section to create your own custom redirect page, but that's no big deal either.

www.MatthewDoucette.com
Friday, July 23, 2004

Sorry, I am a little bit lazy, but I don't understand the problem: If CDs magic names are used, all is handled by CD automatically, isn't it?

Kai Jäger
Saturday, July 24, 2004

Uh, Matthew.  This is planning problem, or lack thereof.

David Burch
Sunday, July 25, 2004

David, I know.  I explained in my first post that "the articles should have been in the proper place right off the bat.  But, it *does* still happen."

Also, one of the most notorious problems of the Internet itself, is broken links.  (Pointing these links to a 404 page is, by no means, a sufficient fix.)  This means there are very few people who plan far enough ahead to avoid all 404 errors from changed URLs.

CityDesk already fixes this problem from within the website itself, which is one of CityDesk's best features.  However, it does not fix it for external links, which any popular site has many of.  Therefore, I think it would a worthwhile feature.

www.MatthewDoucette.com
Sunday, July 25, 2004

Kai Jäger, the problem has nothing to do with links from a CityDesk website to the same CityDesk website.  It is links from an extrenal website to a CityDesk website.

If the URL of an article changes, which happens in CityDesk if you rename the title of the article or move the article, then those external links are now broken.  CityDesk does not have the power to change those links, however it does have the potential to keep both URLs active, and forward the old URLs to the new ones.

www.MatthewDoucette.com
Sunday, July 25, 2004

Matthew,

I wouldn't mind CityDesk doing it though I would like a way to turn it off so that it would not needlessly clutter my folders when I didn't want this feature.

Previous posters mentioned two reasonable work arounds, both of which I have used: An HTML page with a redirect and a nd configuring the web server to redirect those pages.  IMO configuring the web server is best if you have that option.

David Burch
Sunday, July 25, 2004

What would be really neat is if CD just knew which files you wanted to redirect and which to permanently lose and update the .htaccess file (if hosted on linux/unix):

The .htaccess looks like:

Redirect /oldfilename.html http://domain.com/newfolder/newfilename.php

Of course, anything else included in .htaccess (e.g. some of the security info) has to be maintained.

Using .htaccess file at least means that you can maintain all your redirects in one place (or folder) and don't have lots of redirect files floating around your web site.

Dan
Monday, July 26, 2004

David Burch, those two solutions do work, however it is just a matter of productivity.  Such laborious work should be handled by the computer, not the human.

Plus, it will help users who are unaware of this problem.

You mentioned the clutter it would create, a disable feature for those who do not like it is the best solution.  I can see a lot of this clutter would build up when a new site is being developed and a lot of re-working is being performed.

(As for the .htaccess solution, I'm not sure about that right now.  I would just like CD to create the forwarding pages, but perhaps the .htaccess files is more proper.  I'm just not sure on what to think about it right now.)

Thanks for all your input!

www.MatthewDoucette.com
Monday, July 26, 2004

I seriously doubt the Fog Creek guys will add .htaccess redirects to CityDesk. The whole point of CityDesk is that it doesn't rely on anything on the server - it just uploads files that a web server can serve. They're not going to add an Apache-specific feature.

Darren Collins
Monday, July 26, 2004

Darren, good point.  You are absolutely correct.  I wasn't thinking properly about what it is that CityDesk *is*.

Staying with the philosophy of what it is that CityDesk is, I feel it should handle such "arduous" (relatively speaking) tasks such as creating redirect pages, instead of relying on the user to do so. 

www.MatthewDoucette.com
Monday, July 26, 2004

Yeah, it'd be nice if CityDesk could (optionally) set up client-side redirects when you move stuff around.

Darren Collins
Monday, July 26, 2004

I never move anything. What's so hard about staring at a messy directory listing? I never understood the compulsion to constantly reorganize things. The alternative is screwing over people who have linked to you and the people who click on those links. I much prefer accepting messiness.

If it's a matter of looping over a folder with CityScript, you could always just invent a new keyword and loop over that (right?).

rt
Wednesday, August 04, 2004

"If it's a matter of looping over a folder with CityScript, you could always just invent a new keyword and loop over that (right?)."

Someone else sees the the problem is not a problem. I don't think CD should be expected to take care of poor planning on my part, and I'm good at that.

Ron Lane
Wednesday, August 04, 2004

*  Recent Topics

*  Fog Creek Home