[thelist] Trouble with .htaccess Redirects and a Tip

Bob Haroche bharoche at usa.net
Wed Apr 17 10:52:01 CDT 2002


Hello all,

I've done a substantial re-organization of a site and am trying to implement
the Redirect permanent directive with .htaccess to prevent 404's. Everything
works fine for individual files but for entire directories, I'm having
trouble.  Here's my syntax:

Redirect permanent /olddirectory http://myDomain.com/newdirectory/

This works fine IF someone types in http://myDomain.com/oldirectory

BUT if someone types in http://myDomain.com/oldirectory/
(note the trailing slash), they wind up at:

http://myDomain.com/newdirectory//

which, because of the double trailing slashes, results in a 404.

I think I need some sort of regexp pattern or mode re-write directive, but
could use direction on this.  Thanks!

-------------

<tip type="troubleshooting mail cgi scripts">

If you keep getting unexplained server errors when installing cgi scripts
that generate email, check to see whether the email address you're sending
to *actually exists*. If it doesn't, instead of a bounced mail message you
might simply receive a Server 500 error -- which in this case has nothing to
do with your script but simply with the non-existence of the destination
email.

</tip>

-- only took me two hours last week to figure that one out!







More information about the thelist mailing list