xfra35 / f3-multilang

Create multilingual apps with this localization plugin for the PHP Fat-Free Framework
GNU General Public License v3.0
48 stars 13 forks source link

Rerouting for obsolete pages #15

Closed planetahuevo closed 8 years ago

planetahuevo commented 8 years ago

Hi, I am trying to make this work: From here: http://fatfreeframework.com/routing-engine $f3->redirect('GET|HEAD /obsoletepage', '/newpage'); And the problem is that the obsolete page is not working because it has the language before it. /en/obsoletepage So it does not redirect. Any ideas?

Thanks!

xfra35 commented 8 years ago

Sure:

Case 1: the new URL slug depends on the language

$f3->redirect('GET /en/obsoletepage','/en/newpage');
$f3->redirect('GET /fr/obsoletepage','/fr/nouvelle-page');

Case 2: the new URL slug is the same for all languages

$f3->redirect('GET /@lang/obsoletepage','/@lang/newpage');
planetahuevo commented 8 years ago

Case 2 was my problem! I forgot about the @lang thing. :+1: Thanks!