getting ErrorDocument to perform a 'hard' redirect

Hi everyone,

I'd like to have:

ErrorDocument 404 /some/local/url

perform a hard redirect (i.e. it actually sends a 302 back to the client.)

I don't want to specify a full url like this:

ErrorDocument 404 http://some.host:8888/some/local/url

because I don't want to have to inject the host, port and even
http/https into the Apache configuration file.

The only way I can think of doing this is through a combination of
ErrorDocument and mod_rewrite:

ErrorDocument 404 /local-redirect/some/local/url

RewriteRule /local-redirect(/.*) $1 [some flags...]

Just want to make sure I'm not overlooking something (like % macros
which expand to method, host and port of the current request).

btw - I'm using Apache 1.3.41

Thanks,
ER

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
E R [ Do, 01 April 2010 00:59 ] [ ID #2037425 ]

Re: getting ErrorDocument to perform a 'hard' redirect

On 04/01/10 04:29, E R wrote:
> Hi everyone,
>
> I'd like to have:
>
> ErrorDocument 404 /some/local/url
>
> perform a hard redirect (i.e. it actually sends a 302 back to the client.)
>
> I don't want to specify a full url like this:
>
> ErrorDocument 404 http://some.host:8888/some/local/url
>
> because I don't want to have to inject the host, port and even
> http/https into the Apache configuration file.
>
> The only way I can think of doing this is through a combination of
> ErrorDocument and mod_rewrite:
>
> ErrorDocument 404 /local-redirect/some/local/url
>
> RewriteRule /local-redirect(/.*) $1 [some flags...]
>
> Just want to make sure I'm not overlooking something (like % macros
> which expand to method, host and port of the current request).
>
> btw - I'm using Apache 1.3.41
>
> Thanks,
> ER
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See<URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
> " from the digest: users-digest-unsubscribe [at] httpd.apache.org
> For additional commands, e-mail: users-help [at] httpd.apache.org
>

I didn't understand your problem clearly, but I think you're looking for
RedirectMatch.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Nilesh Govindrajan [ Do, 01 April 2010 03:46 ] [ ID #2037428 ]
Webserver » gmane.comp.apache.user » getting ErrorDocument to perform a 'hard' redirect

Vorheriges Thema: Conditionally process directives based on environment variable values
Nächstes Thema: timeout experience