The Saltmine Chronicles

Behind the scenes at a web hosting company

Clusty Controls

“My site is down! Fix it!” Redux part II

by Sean Conner
on Friday, October 13, 2006

Okay, so it was a little bit longer than a few days, but this site has moved to it's new (and hopefully, final) location and server.

Technobabble and an apology

To the one person who's currently subscribed to the Atom feed, I must apologize for screwing up the entry IDs and throwing a whole batch of previously read entries as new. The software used for this blog, mod_blog has very minimal support for entry IDs and no support for preserving IDs across domain moves. But I wasn't expecting the Spanish Inquisition Mistah Wheelus to get this blog its own domain name.

Sorry.

When I originally changed the domain of this blog, just the domain changed, not the server is was on. Since we run Apache, it was a simple matter to configure the webserver as:

<VirtualHost 66.252.227.139>
  ServerName    saltmine.pickint.net
  ServerAlias	pb1.flummux.org

  # A whole bunch of other directives
  # that we needn't get into at this
  # time ... 

</VirtualHost>

Notice how the old domain name was configured as an alias. This told Apache to respond to pb1.flummux.org as well as saltmine.pickint.net. The reason for this is to prevent any links (like there were any at that time) from breaking. It also meant that any search results (like any search engine had actually indexed the site at that time) wouldn't break either, and that's a very important thing.

But since we not only changed names, but server as well, such a trick won't work. And by this time, we have been indexed, and have a few links and whatnot. In this case, to prevent the links (and to keep any Google juice we might have) we have to take a different approach.

So, after setting up the new domain and making sure the blog works on the new server, I went back to the original server, and made a slight change to the configuration:

<VirtualHost 66.252.227.139>
  ServerName	saltmine.pickint.net
  ServerAlias	pb1.flummux.org

  Redirect 	permanent / http://www.saltminechronicles.com/

  # every other directive has been deleted,
  # as they're not required any more

</VirtualHost>

This particular Redirect directive of Apache instructs web browsers that everything on the site has moved permanently to a new location and to use that location from now on (and a browser should update any bookmarks for the old site to use the new site without having the user do anything).

Technobabble

The web protocol, HTTP, includes a mechanism to inform the client side (that's the browser) that a resource (say, an image) has moved to a new location—a “redirect.” The two most common types are the “temporary redirect” and the “permanent redirect” and they are pretty much what they say.

From the actual protocol (which seems pretty straightforward to me):

10.3.2 301 Moved Permanently

The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible. …

10.3.3 302 Found

The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. …

Status Code Definitions

(Just for the record, a URI is a more technically “pure” term for a URL and has a specific meaning. If you really want to be pedantic about it, all URLs are URIs, but not all URIs are URLs. But this is a bit too much heavy wizardry even for the Technobabble sections.)

And the Redirect can be used even if you aren't planning on moving your site to a new domain name, it can be used when you reorganize your website. Here's an example from a friend's site after he restructured his site:

Redirect permanent /software/seminole http://gladesoft.com/products/seminole/
Redirect permanent /software/seminole/ http://gladesoft.com/products/seminole/

Nothing else on the site changed except for the renaming of the software folder to products. No links were broken, and more importantly, no Google juice was lost.

Fortunately, the Redirect directive is not restricted to the main Apache configuration file (which you probably don't have access to if you don't host your own site)—they can be placed within an .htaccess file (which is a file that resides within your webhosting space on the server).

So hopefully, this is the latest last location of this blog and it won't be changing any time soon.

You have permission to link freely to any entry here.

Employees, customers and agents of Pick Internet maintain this web site to enhance public access to the general information about web hosting and Internet service issues. This is a service that is continually under development. While we try to keep the information timely and accurate, we make no guarantees. We will make an effort to correct errors brought to our attention. Users should be aware that the information available on this web site may not reflect official positions of Pick Internet or its management.

Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not constitute or imply its endorsement, recommendation, or favoring by Pick Internet. The views and opinions of authors expressed herein do not necessarily state or reflect those of Pick Internet.

With respect to documents available from this server, neither Pick Internet nor any of their employees, agents or customers assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information disclosed, or represents that its use would not infringe privately owned rights.

The documents on this web site contain hypertext pointers to information created and maintained by other public and private organizations. Please be aware that we do not control or guarantee the accuracy, relevance, timeliness, or completeness of this outside information. Further, the inclusion of pointers to particular items in hypertext is not intended to reflect their importance, nor is it intended to endorse any views expressed or products or services offered by the author of the reference or the organization operating the server on which the reference is maintained.

Copyright © 2006-2007 by Sean Conner. All Rights Reserved.