View Full Version : Solved Multi lang in url permanent redirects

24-02-11, 14:56
From my past issue of having multiple lang sections in a urls such as site.com/ru/gl/ru/page.html a fix was made to re-direct the pages to the correct page, but the re-direct is a temp redirect instead of a hard permanent re-direct

Status: HTTP/1.1 302 Moved Temporarily

not a permanent re-direct?

Can we update this asap?



24-02-11, 20:19
Yes, For vBET4 it is very easy, for vBET3 - not, but It will be done.. I will prepare a solution for you.

25-02-11, 12:47
ok I have a quick fix for you:
1. open and make a copy of this file:
forum root/includes/vbenterprisetranslator_functions.php
2. in this file find:

3. paste BEFORE this code:

function vbet_vb_exec_header_redirect($url)
global $vbulletin;

$url = create_full_url($url);
$url = str_replace('&', '&', $url); // prevent possible oddity

if (strpos($url, "\r\n") !== false)
trigger_error("Header may not contain more than a single header, new line detected.", E_USER_ERROR);

header("Location: $url", 0, 301);

if ($vbulletin->options['addheaders'] AND (SAPI_NAME == 'cgi' OR SAPI_NAME == 'cgi-fcgi'))
header('Status: 301 Moved Permanently');

define('NOPMPOPUP', 1);
if (defined('NOSHUTDOWNFUNC'))
4. save a file.
5. open and make a copy of this file:
forum root/includes/vbenterprisetranslator_functions.php
6. in this file find:

function vbet_redirectDoubleLang()
7. in this function find:


8. and replace with:

9. save a file and test it.

Already done - will be included in the next relase.

26-02-11, 16:49
not sure the reason i still gte the 302 temp

Status: HTTP/1.1 302 Moved Temporarily

28-02-11, 09:33
Sorry, now you have a good solution in my previous post, please check it!

01-03-11, 22:24
I added the function, and the call to this funtion instead of the old redirect and get the same 302 temp?

Am I missing somthing?

04-03-11, 10:05
can you explain me where you checked that you have a 302 redirect?

09-03-11, 11:52
all changes are made.

AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
vBET 4.10.1 gives automatic translations