Mailing List Archive

Redirection with "Location" header?
Hello,

is it possible to use a Location header for redirects?

Andreas
Re: Redirection with "Location" header? [ In reply to ]
Andreas Schwarz wrote:
> is it possible to use a Location header for redirects?

If you really want this, you might try adding a fake interwiki prefix
that points back at your wiki:

INSERT INTO interwiki (iw_prefix,iw_url)
VALUES ('redirect', 'http://your.wiki.site/index.php/$1');

Then make redirects like this:

#REDIRECT [[redirect:Some other page]]

This should enable the interwiki redirect mode, which uses a Location:
header. Be warned though that these are a pain in the ass: you can't
easily get back to edit the source page because there's no backlink.

-- brion vibber (brion @ pobox.com)
Re: Redirection with "Location" header? [ In reply to ]
Brion Vibber wrote:
> Andreas Schwarz wrote:
>> is it possible to use a Location header for redirects?
>
> If you really want this,

Yes, because I don't want to have the same content available under
different URLs.

> you might try adding a fake interwiki prefix
> that points back at your wiki:
>
> INSERT INTO interwiki (iw_prefix,iw_url)
> VALUES ('redirect', 'http://your.wiki.site/index.php/$1');
>
> Then make redirects like this:
>
> #REDIRECT [[redirect:Some other page]]

Thanks, I'll try it.

> This should enable the interwiki redirect mode, which uses a Location:
> header. Be warned though that these are a pain in the ass: you can't
> easily get back to edit the source page because there's no backlink.

Not a big problem.