Featured Post

On The Road To Changes: Separation of Concerns

The goal of this article is to promote and give an overview of Separation of Concerns. So, when I first started to make websites, I would have one HTML page that had all the CSS and JS. Looked great, awesome! Then ten years ago I started to learn PHP, I was in 10th/11th grade.  I started to create dynamic...

Read More

Useful Rewrite when moving to/from a CMS

Posted by Kyle | Posted in Public | Posted on 23-08-2010

Tags: , , , ,

0

We often move sites in and out of various content management systems to best fit our needs, and sometimes, you want to change the URLs. In our most recent case, we were moving from an old installation of wordpress, into a smaller, centralized static HTML site. The problem that came up, is that we wanted our URLs to end in .html to match the rest of the non-CMS pages, while the current wordpress installation had them all ending in slashes. Obviously, we don’t want to have to map one-to-one an old URL to a new URL, and we don’t want to be too generic to have a bunch of URLs 301 to a new URL to only 404 when it gets there. So this solution checks for a valid file before sending the visitor a 301.