View Full Version : Solved Multi lang in url permanent redirects
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?
Thanks!
Chris
kamilkurczak
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.
kamilkurczak
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'))
{
exec_shut_down();
}
exit;
}
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:
exec_header_redirect($url);
8. and replace with:
vbet_vb_exec_header_redirect($url);
9. save a file and test it.
Already done - will be included in the next relase.
not sure the reason i still gte the 302 temp
Status: HTTP/1.1 302 Moved Temporarily
kamilkurczak
28-02-11, 09:33
Sorry, now you have a good solution in my previous post, please check it!
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?
kamilkurczak
04-03-11, 10:05
can you explain me where you checked that you have a 302 redirect?
kamilkurczak
09-03-11, 11:52
all changes are made.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.