[MediaWiki-l] REDIRECT with Status 301

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] REDIRECT with Status 301

Christian Schröder
Hello,

i am very new to mediawiki and i am helping an existing installation. We
would like to move some pages to a new wiki and tried use the #Redirect
directive with interwiki links.

This works so far but it issues 302 Found HTTP Status code. We would
like to use the status code 301 to help the search engines.


Can the #Redirect mechanism be used for this?


The documentation at https://www.mediawiki.org/wiki/Help:Redirects did
not indicate any solution.

I found in the mailing list only this thread from February 2014
https://www.mail-archive.com/mediawiki-l@.../msg13247.html

Also not conclusive but leaning in the direction of no, not possible.

I tried to skim through the mediawiki codebase and found redirect
handling in includes/MediaWiki.php L226 [1]. I cannot understand it
fully, but it seems not to be possible.


If there is no native/builtin way to do this, is there an extension
which might be able to this (redirect individual pages via Status 301 to
another interwiki page).



thank you

Christian






[1]
https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/MediaWiki.php;75160bdd3b4ac3642d147cda46e47c809999937d$226

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: REDIRECT with Status 301

Amanda Quad
Hello,
The #REDIRECT function is only for redirecting pages within your wiki to other pages within your wiki. It cannot be used to redirect pages within your wiki to another external non-MediaWiki site. However, if you are using https://mediawiki.org/wiki/Extension:Interwiki you can set up interwiki prefixes to Point to other MediaWiki sites, for example, Wikipedia.
Examples:
* If you want your wiki page “Test” to automatically redirect users who open it to the page “Example”, you can replace all content on the page “Test” with #REDRIECT [[Example]]
* If you have configured a prefix for Wikipedia in Special:Interwiki (usually something like “en:” or “wikipedia:”), you can do an interwiki soft redirect between your wiki and Wikipedia. However please note that soft redirects do not redirect users automatically - they require the users to click on the redirect link. So, if you wanted to redirect the page “Test” on your wiki to the Wikipedia Main Page, and you were using en: as the interwiki prefix, you would replace all content on the page “Test” on your wiki with #REDIRECT [[:en:Main Page]].
Hope this helps.
— Amanda


On Monday, January 1, 2018, 3:04 PM, Christian Schröder <[hidden email]> wrote:

Hello,

i am very new to mediawiki and i am helping an existing installation. We
would like to move some pages to a new wiki and tried use the #Redirect
directive with interwiki links.

This works so far but it issues 302 Found HTTP Status code. We would
like to use the status code 301 to help the search engines.


Can the #Redirect mechanism be used for this?


The documentation at https://www.mediawiki.org/wiki/Help:Redirects did
not indicate any solution.

I found in the mailing list only this thread from February 2014
https://www.mail-archive.com/mediawiki-l@.../msg13247.html

Also not conclusive but leaning in the direction of no, not possible.

I tried to skim through the mediawiki codebase and found redirect
handling in includes/MediaWiki.php L226 [1]. I cannot understand it
fully, but it seems not to be possible.


If there is no native/builtin way to do this, is there an extension
which might be able to this (redirect individual pages via Status 301 to
another interwiki page).



thank you

Christian






[1]
https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/MediaWiki.php;75160bdd3b4ac3642d147cda46e47c809999937d$226

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: REDIRECT with Status 301

Martin Urbanec
In reply to this post by Christian Schröder
Hello,

I do not think it's good idea. Redirect can be temporary and 301 can cause
damage then.

Martin

po 1. 1. 2018 v 21:05 odesílatel Christian Schröder <
[hidden email]> napsal:

> Hello,
>
> i am very new to mediawiki and i am helping an existing installation. We
> would like to move some pages to a new wiki and tried use the #Redirect
> directive with interwiki links.
>
> This works so far but it issues 302 Found HTTP Status code. We would
> like to use the status code 301 to help the search engines.
>
>
> Can the #Redirect mechanism be used for this?
>
>
> The documentation at https://www.mediawiki.org/wiki/Help:Redirects did
> not indicate any solution.
>
> I found in the mailing list only this thread from February 2014
> https://www.mail-archive.com/mediawiki-l@.../msg13247.html
>
> Also not conclusive but leaning in the direction of no, not possible.
>
> I tried to skim through the mediawiki codebase and found redirect
> handling in includes/MediaWiki.php L226 [1]. I cannot understand it
> fully, but it seems not to be possible.
>
>
> If there is no native/builtin way to do this, is there an extension
> which might be able to this (redirect individual pages via Status 301 to
> another interwiki page).
>
>
>
> thank you
>
> Christian
>
>
>
>
>
>
> [1]
>
> https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/MediaWiki.php;75160bdd3b4ac3642d147cda46e47c809999937d$226
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: REDIRECT with Status 301

Christian Schröder
In reply to this post by Amanda Quad
On 01.01.18 21:18, Amanda Quad wrote:
> Hello,
> The #REDIRECT function is only for redirecting pages within your wiki to other pages within your wiki. It cannot be used to redirect pages within your wiki to another external non-MediaWiki site. However, if you are using https://mediawiki.org/wiki/Extension:Interwiki you can set up interwiki prefixes to Point to other MediaWiki sites, for example, Wikipedia.
> Examples:
> * If you want your wiki page “Test” to automatically redirect users who open it to the page “Example”, you can replace all content on the page “Test” with #REDRIECT [[Example]]
> * If you have configured a prefix for Wikipedia in Special:Interwiki (usually something like “en:” or “wikipedia:”), you can do an interwiki soft redirect between your wiki and Wikipedia. However please note that soft redirects do not redirect users automatically - they require the users to click on the redirect link. So, if you wanted to redirect the page “Test” on your wiki to the Wikipedia Main Page, and you were using en: as the interwiki prefix, you would replace all content on the page “Test” on your wiki with #REDIRECT [[:en:Main Page]].


Hello Amanda,
thanks for the reply. This is exactly what we do, sorry for cutting
short my description. And we were happy that #REDIRECT just works with
interwiki links.

But our problem is the status code of the redirect.


Some more background behind the problem:

We try to split our current wiki into 2 separate ones, because our users
have multiple use cases for it and it gets confusing for everyone having
articles usable in one use case and others in other use cases.
And new users are even more confused what they are supposed to find or do.

So what we try to do is "extract" all pages from one use case into a new
wiki. That is why the permanent redirect with 301 is from our
perspective the correct thing, because the topic/page will not ever need
to come back.

thanks for your help
Christian



_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: REDIRECT with Status 301

Amanda Quad
Hello,
Unfortunately what you’re trying to do isn’t possible.
If you want to export your entire wiki and import it to a new location (and the wiki is fairly small), you can go to Special:Export on the original wiki, and enter Special:AllPages as the “page to export”. Make sure you check the box that says “include templates”. This will supply all pages of the wiki into an XML file, which you can then import via Special:Import on the new wiki.
Note however that if your wiki is very large, you cannot export/import on-wiki and will need to use a server-side maintenance script (I don’t remember the name of the top of my head).
It is not possible to completely redirect one wiki site to an entirely different wiki site - redirects can only be used for redirecting one page to another page. However, if you own the URL domain to the current wiki, once you’ve exported/imported to the new site, you can redirect the URL to the new wiki, so that when visitors click the old URL they will automatically go to the new URL. I don’t know how to do this since I’ve never run a website on a personal server, but I know that it is possible.
— Amanda


On Tuesday, January 2, 2018, 9:46 AM, Christian Schröder <[hidden email]> wrote:

On 01.01.18 21:18, Amanda Quad wrote:
> Hello,
> The #REDIRECT function is only for redirecting pages within your wiki to other pages within your wiki. It cannot be used to redirect pages within your wiki to another external non-MediaWiki site. However, if you are using https://mediawiki.org/wiki/Extension:Interwiki you can set up interwiki prefixes to Point to other MediaWiki sites, for example, Wikipedia.
> Examples:
> * If you want your wiki page “Test” to automatically redirect users who open it to the page “Example”, you can replace all content on the page “Test” with #REDRIECT [[Example]]
> * If you have configured a prefix for Wikipedia in Special:Interwiki (usually something like “en:” or “wikipedia:”), you can do an interwiki soft redirect between your wiki and Wikipedia. However please note that soft redirects do not redirect users automatically - they require the users to click on the redirect link. So, if you wanted to redirect the page “Test” on your wiki to the Wikipedia Main Page, and you were using en: as the interwiki prefix, you would replace all content on the page “Test” on your wiki with #REDIRECT [[:en:Main Page]].


Hello Amanda,
thanks for the reply. This is exactly what we do, sorry for cutting
short my description. And we were happy that #REDIRECT just works with
interwiki links.

But our problem is the status code of the redirect.


Some more background behind the problem:

We try to split our current wiki into 2 separate ones, because our users
have multiple use cases for it and it gets confusing for everyone having
articles usable in one use case and others in other use cases.
And new users are even more confused what they are supposed to find or do.

So what we try to do is "extract" all pages from one use case into a new
wiki. That is why the permanent redirect with 301 is from our
perspective the correct thing, because the topic/page will not ever need
to come back.

thanks for your help
Christian



_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l