Handling File Renames

Coordinator
Jun 7, 2011 at 11:46 PM

Today I spent some time trying to solve the issue of how to handle file renames and still support deep links to the old files (see bug #18). I figure that changing a file name should not be taken too lightly so it isn’t something that should be super easy to do nor should it be something automatic. Keeping that in mind the simplest way to handle renames is to add a .cshtml with the same name and just add a permanent redirect.

@Response.RedirectPermanent("~/Docs/Folder/File")

I like this approach but I wanted the files to have more context that they should only be uses as redirects. So what I am purposing is a .redirect file. It would basically be just a .cshtml file but with a different extension. Having this will help separate possible content files with files that are only used to redirect to other pages. I have this working and it was very simple but I want to get feedback from everyone.

Is this a work flow that people like? Is the too much work? Would people just prefer a .cshtml file?

Feb 16, 2012 at 3:55 AM

Thank you for the tip. It was really helpful.

 

____________________

Internet Marketing Ideas