.htaccess problems


I’ve created a simple .htaccess to redirect users with old URLs to newly named pages. I’m using Movable Type’s template engine to do this. Whenever I rebuilding this template, my entire domain is disabled and I get a 500 Internal Server Error.

It really is a simple file - just a list of Redirects, like this:

Redirect /retro/001893.html /2004/05/25/00.08.57/ Redirect /retro/001892.html /2004/05/24/21.55.25/ Redirect /retro/001734.html /2004/05/12/21.00.25/ Redirect /retro/001733.html /2004/05/11/13.23.18/ Redirect /retro/001732.html /2004/05/09/16.56.24/ Redirect /retro/001731.html /2004/05/07/08.58.36/ I’ve tried ‘Redirect 301’ and ‘RedirectPermanent’ - nothing. Also, the file is CHMOD 644 …


What does it say in the error.log file?

:cool: Perl / MySQL / HTML+CSS


[Tue May 25 06:44:26 2004] [alert] [client] /home/nothere/all/.htaccess: Redirect to non-URL
… a lot!


Which means you messed up. You know, the Apache documentation is online. Here is what it says for the Redirect directive:


:cool: Perl / MySQL / HTML+CSS


Atropos gave you a reference link that explains it. The plain english answer is that you need to write the full URL in the redirect target, like:

Redirect /from/here.html http://site.com/to/here/



Thanks everyone for your help. I discovered that RedirectMatch works where Redirect won’t. Why, I’m not entirely sure (I’m not using regular expressions at all) but it works.

Here’s the syntax I’m using:

RedirectMatch 301 /from/here.php /to/there