Things look quiet here. But I've been doing a lot of blogging at
dan.langille.org because I prefer WordPress now.
Not all my posts there are FreeBSD related.
I am in the midst of migrating The FreeBSD Diary over to WordPress
(and you can read about that here).
Once the migration is completed, I'll move the FreeBSD posts into the
new FreeBSD Diary website.
Redirecting URL requests with Apache19 January 2000
This article shows a quick and easy way to deal with URLs that have
changed to another server. I used this for my website when I split it up into four
What does a redirect do?
A redirect allows you to specify that a requested document is no
longer at the specified URL and provide the new and correct URL. This feature is
extremely useful when rearranging a website. I also consider such redirects to be a
courtesy to the users of the website. It is also a selfish act upon the part of the
website owner. I mean, I want you to find what you want. So it is in my best
interests to make that process as easy as possible. A redirect is one such tool to
ensure your readers find what they want.
At one time, my website contained four
When I split these four domains up into their own websites I wanted the original URLs
to still work, as much as possible. But people were accessing different sections of
the website using the "wrong" URL. That is to say, some of the FreeBSD
Diary data was being fetched with the racingsystem.com domain. I wanted that to
still work. At least until such time as I was able to track down some of the
referring URL and get them updated.
I can think of two main reasons why redirections are important.
A redirect allows people to find the documents they want. This is especially
important when you consider the bookmarks which people have made. If people can
continue to find the documents they have referenced before, they are much more likely to
continue to use your website.
A redirect allows the URLs contained within search engines to continue to work.
This helps people who use the search engines to look for information. I also
suspect, but I am not positive, that the search engines will notice that the URL has
changed and automatically update their records. I say suspect because the return
code is a 301 (to indicate the permanent move of a file).And more importantly, the
contents of the search engines will still work. More on the details of the 301 code
As you can see, if you click on the above link, you wind up back at the FreeBSD Diary
home page. All URLs which specify the the /freebsd directory will be redirected to
the URL specified at the end of the line. Note: at that website I do even more
processing to get the people to the correct URL. See Rewriting
URLs within Apache for more information.
The above was an example of a moved directory. Now let us consider a moved file.
Here's what I do for that instance: