Forum Moderators: phranque

Message Too Old, No Replies

.htaccess redirect issue

Sorry for poor subject, hard to explain in one line. ;)

         

MatthewHSE

10:24 pm on Nov 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know the subject line isn't very descriptive, but I couldn't think of a good way to summarize the question...

I have a domain that is basically just being used as a pointer toward specific pages on another domain. I need to be able to use .htaccess to handle the redirects.

I need to forward all requests for the domain to a page on the other domain, like this...

Redirect 301 / [mysite.com<...]

...which I know will send all requests for any page on the placeholder domain to the same location on the second domain. That's what I want, with exceptions. And it's the exceptions that have me stumped.

In addition to sending folks on to the same location at the new domain, there are a few specific URL's that need special instructions. So in addition to the above rule, I need some way to also accomplish the following, for each of about 25 URL's:

Redirect 301 /225 [mysite.com...]

But I can't get any of this to play well together. What do I need to do to make it work?

In case it helps, the 25 "exceptions" will always be as shown above - a sequence of three numbers, being treated as a directory on the first domain, but needing to be forwarded to a script on the second domain with the three numbers being used as the query string.

jdMorgan

11:00 pm on Nov 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to use RedirectMatch (mod_alias) or mod_rewrite. Put the redirects for the 'exceptions' first, and then redirect anything that's left after processing the exceptions to the catch-all page on the new domain.

Alternatively, you could redirect all requests to the new domain, and sort out the exceptions upon arrival at the new domain.

Jim