Created
March 18, 2014 19:30
-
-
Save marcus-at-localhost/9627579 to your computer and use it in GitHub Desktop.
Joomla Language 303 redirect to better 301 redirect (/plugins/system/languagefilter/languagefilter.php)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// redirect if sef does not exists | |
// around line 226 | |
if (!isset(self::$sefs[$sef])) | |
{ | |
// Use the current language sef or the default one | |
$sef = isset(self::$lang_codes[$lang_code]) ? self::$lang_codes[$lang_code]->sef : self::$default_sef; | |
$uri->setPath($sef . '/' . $path); | |
if ($app->getCfg('sef_rewrite')) { | |
// append true for 301 redirect | |
$app->redirect($uri->base().$uri->toString(array('path', 'query', 'fragment')),'','',true); | |
} | |
else { | |
$path = $uri->toString(array('path', 'query', 'fragment')); | |
// append true for 301 redirect | |
$app->redirect($uri->base().'index.php'.($path ? ('/' . $path) : ''),'','',true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment