Jump to content

Multilingual 301 redirects


yellowled
 Share

Recommended Posts

Basically just asking to confirm, but since I could not find any results – I'm currently rebuilding a multilingual site in PW. That means a lot of URLs changed. I usually like to use ProcessRedirects for that, but it does not seem to want to accept my multilingual URLs – the /en/ prepended to English pages (default language is German) is removed from any URL the Redirects list in the backend (yes, I double-checked).

Is the Redirects module not “compatible” with multilingual sites, am I using it wrong or do I have to enter all those 301s in the .htaccess?

Link to comment
Share on other sites

Have you tried the PagePathHistory module? It handles the redirections automagically under the hood whenever you change a pathname. (If I remember right, it is a core module(?) by default disabled)

Link to comment
Share on other sites

Have you tried the PagePathHistory module? It handles the redirections automagically under the hood whenever you change a pathname.

I have not. I assumed that this was/is meant for URL that change “within” ProcessWire, i.e. if I change /foo/ to /bar/ and have already placed links to /foo/ etc. This is about a site that currently runs on Contao and is being ported to PW, so I need redirects from /foo.html to /bar/.

I just realized I probably don't want to use ProcessRedirects anyway since it will need a fair amount of redirects. That's got to be a preformance hit at some point, right? We're talking about 60 Redirects altogether here. Also, I'll probably need some RegEx redirects, that's not even possible using a modules, is it?

Link to comment
Share on other sites

Thanks for the input, guys. So here's what I ended up doing in case anyone stumbles across this in the future:

I found a post by Ryan via search which explains how to set up 301 redirects via .htaccess in PW (I ran into the error which is mentioned there as well). You can shorten Ryan's rule there by using “[R=301,L]”, but other than that, that's how it works.

I now have about 50 “plain” rewrite rules (redirecting foo.html to /bar/) and about 10 using a regexp. I don't notice a performance hit (I have no way of measuring properly, though; it's shared hosting), also 2 people working at hosting companies have assured me that RewriteRule should not affect performance (on a properly configured Apache).

  • Like 5
Link to comment
Share on other sites

Basically just asking to confirm, but since I could not find any results – I'm currently rebuilding a multilingual site in PW. That means a lot of URLs changed. I usually like to use ProcessRedirects for that, but it does not seem to want to accept my multilingual URLs – the /en/ prepended to English pages (default language is German) is removed from any URL the Redirects list in the backend (yes, I double-checked).

I've accomplished that using the module Jumplinks. See this thread and let me know if it helps: https://processwire.com/talk/topic/8697-jumplinks/?p=113416

  • Like 2
Link to comment
Share on other sites

See this thread and let me know if it helps

As mentioned before, I went with RewriteRule in .htaccess, which works well. I'm not sure anything else would have worked here because in addition to being multilingual, the original site also used different page titles in both languages, i.e. /foo.html in German could have been /bar.html in English. I have only skimmed the thread you linked to, so I'm not sure if Jumplinks could manage that.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...