Forum Moderators: phranque

Message Too Old, No Replies

RedirectMatch problem

403's when redirecting from a page that doesn't exist

         

JaxM

7:16 am on Jul 26, 2005 (gmt 0)

10+ Year Member



Hello,

I'm having a problem with RedirectMatch handling 404s. I have a redirect match set up to redirect all requests to a directory and its subdirectories to another directory.

RedirectMatch /at/TechZone [domain.com...]

This works fine for redirecting a request to /at/TechZone/blah or another subdirectory that exists. The problem is that when I request a page in /at/TechZone (such as /at/TechZone/adfhakdf) that doesn't exist, I get a 403 error.

Any ideas?

jdMorgan

8:27 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



JaxM,

Welcome to WebmasterWorld!

Please post the ErrorDocument directive that you have defined -- There's no way to tell what's going on if we don't know what that looks like, and where it is located in relation to the path that fails.

In situations like this, we need to know what the code looks like, and also where it is located. For example, if your error documents are located in a path that will match your RedirectMatch, then they too will be redirected, which is bad for many reasons. If this is the case, and it can't be changed, then look into using mod_rewrite instead of mod_alias to do your redirects -- mod_rewrite gives you the ability to do more complex conditional rewrites or redirects.

Jim

JaxM

11:47 pm on Jul 26, 2005 (gmt 0)

10+ Year Member



There currently isn't an ErrorDocument directive defined. Another problem is that mod_rewrite isn't an option.

jdMorgan

11:58 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's nothing intrinsically wrong with your code, so it looks like your server is misconfigured, and like you might want to consider another host if you want to do things like redirects and rewrites.

Sorry I can't help more.

Jim