Gabriel Reid wrote:
> Robi wrote:
>> I want to redirect everyting that goes to
<font color=green> >> <a style='text-decoration: underline;' href="http://myweb.TLD/foo/bar/</font" target="_blank">http://myweb.TLD/foo/bar/</font</a>>
>> to
<font color=green> >> <a style='text-decoration: underline;' href="http://otherweb.TLD/foobar/index.php?page=getfirstpage</font" target="_blank">http://otherweb.TLD/foobar/index.php?page=getfirstpage</font</a>>
[...]
>> Redirect permanent /foo/bar
<font color=green> >> <a style='text-decoration: underline;' href="http://otherweb.TLD/foobar/index.php?page=getfirstpage</font" target="_blank">http://otherweb.TLD/foobar/index.php?page=getfirstpage</font</a>>
>> adds index.html at the end to getfirstpage (getfirstpageindex.html), and
>> Redirect permanent /foo/bar/index.html
<font color=green> >> <a style='text-decoration: underline;' href="http://otherweb.TLD/foobar/index.php?page=getfirstpage</font" target="_blank">http://otherweb.TLD/foobar/index.php?page=getfirstpage</font</a>>
>> only serves index.html.
[...]
> First, an explanation of what is happening here. The idea of Redirect is to
> redirect the request on the server and path that the incoming request had.
> Therefore, it doesn't suit your purposes, because you want all requests,
> regardless of their path (past /foo/bar) to go to one specific page.
>
> If you first example, the server is giving the browser an initial redirect
> to its own index.html page, then when the browser requests index.html, it
> re-maps the index.html request onto the otherweb request and sends back the
> redirect.
>
> In the second example, the redirect will only work if you _specifically_
> request index.html. Just requesting the directory won't work.
>
> So, the solution: I would recommend using the RedirectMatch directive, as
> follows:
>
> RedirectMatch 301 /foo/bar/
<font color=purple> > <a style='text-decoration: underline;' href="http://otherweb.TLD/foobar/index.php?page=getfirstpage</font" target="_blank">http://otherweb.TLD/foobar/index.php?page=getfirstpage</font</a>>
> ^ don't forget this last slash
Fantastic!
Thanks a lot!
After I saw your reply, I re-read the mod_alias documentation (redirect)
again. I don't know how I overlooked RedirectMatch. It was right there.
Your explanation and example helped me better understand it.
Thanks.
--
Robi<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: puzzled with redirect