HTTP Error 301: Permanent Redirect

A while ago, I explained how I configured the server to return HTTP Error 410: Gone for all requests for pages created with my old CMS. After installing Movable Type, all pages of my site moved to another location, and I was not able to work out the new location of the files. In short, error 410 says: The requested file used to exist on this location, but it has gone to an unknown location. This message is more clear than the message returned by default; the famous 404.

I always check the server logs for 404 messages, since it might indicate that a link on the site is wrong and I'll have to fix that. One of the files coming up regulary in that log is the default MT stylesheet styles-site.css, which I have replaced by my own stylesheet with a different name. I immediately wanted to add this file to my '410--list', but then I realised that 410 is not the correct code, since I do know where the file went. Therefore a better solution would be to return code 301 (permanent redirect) together with the new location, so any smart client would simply redirect to the new address.

To implement this, I only needed to add a single line to the .htaccess file:

Redirect permanent /styles-site.css http://www.braintags.com/paz.css

This line tells the server to redirect requests for /styles-site.css with code 'permanent' to the file http://www.braintags.com/paz.css. Remember that the destination always has to be a complete URL!!

Leave a comment

Monthly Archives

Recent Entries

  • Comments and tweets

    A recent trend in the blogosphere has been to add **tweets as comments** on posts. I understand where this comes from, as in general...

  • Manifiesto «En defensa de los derechos fundamentales en internet»

    Ante la inclusión en el Anteproyecto de Ley de Economía sostenible de modificaciones legislativas que afectan al libre ejercicio de las libertades de expresión, información...

  • Commenting not possible

    I just discovered that it currently is not possible to comment on this blog. At first sight it looks like the problem is caused...

  • Back from the CeBIT

    I am back from the CeBIT show. Actually, I came back on Monday, but have been too busy to post. This year has been...

  • Downloading viruses?

    I just saw the screen above, which is the ClamWin antivirus software uploading its virus database. On the left hand side they have an animation...

Close