HTML and CSS Reference
In-Depth Information
Move a Page
Reorganize your URL structure to be more transparent to developers, visitors, and search engines, but always
make sure the old URLs for those pages still work.
http://www.example.com/framework/wo/9t5oReW4DX1d7/0.0.1.172.1.1
http://www.example.com/boredofdirectors/bios/
http://www.example.com/2007/05/23/1756?id=p12893
http://www.example.com/products/carburetors/
http://www.example.com/boardofdirectors/bios/
http://www.example.com/pr/TIC-patents-new-fuel-efficient-engine
Motivation
In the words of the W3C, "Cool URIs don't change." Once you publish a URI, you should endeavor to make sure
that content remains at that URI forever. Other sites link to the page. Users bookmark it. Every time you
reorganize your URL structure you are throwing away traffic.
However, you do need to move pages. Sometimes it's a matter of search engine optimization. Sometimes it's
mandated by a change to a new content management system (CMS) or server-side framework. Sometimes it's
necessary just to keep the development process sane by keeping related static files close together.
Thus, the compromise: Move pages as necessary, but leave redirects behind at the old URLs to point users to
the new URLs. Done right, users will mostly never notice that this has happened.
Potential Trade-offs
As long as you don't actively break links, most external sites that point to you won't bother to update their
links. Then again, most of them won't update their links no matter what you do. That's why you need to keep
the old links working.
Mechanics
Every time you move a page, set up a redirect from the old page to the new page. In other words, configure
your web server so that rather than sending a 404 Not Found error when a visitor arrives at the old location, it
sends a 301 Moved Permanently or 302 Found response.
For example, when I published my first book, I put the examples at www.cafeaulait.org/examples/ . When I
published my second book, I needed to split that up by book, so I moved those files to
www.cafeaulait.org/books/jdr/examples/ . However, if you go to www.cafeaulait.org/examples/ , the server
sends this response:
HTTP/1.1 302 Found
Date: Fri, 06 Apr 2007 17:34:27 GMT
Server: Apache/2
Location: http://www.cafeaulait.org/books/jdr/examples
Content-Length: 298
Content-Type: text/html; charset=iso-8859-1
Search WWH ::




Custom Search