Important: This page is using cookies (cookies). Using this website without turning off cookies in browser, means that you agree for using it.
Buy Now! Features Downloads

Earn with us!

If you would like to start earning money with vBET join to Affiliate Program.
Results 1 to 8 of 8

Thread: Multi lang in url permanent redirects

  1. #1
    Senior Member
    Join Date
    Jun 2010
    Posts
    276

    Default 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

  2. #2
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    Yes, For vBET4 it is very easy, for vBET3 - not, but It will be done.. I will prepare a solution for you.

  3. #3
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    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:
    PHP Code:
    ?> 
    3. paste BEFORE this code:
    PHP 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"0301);

        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:
    PHP Code:
    function vbet_redirectDoubleLang() 
    7. in this function find:
    PHP Code:
    exec_header_redirect($url); 
    8. and replace with:
    PHP Code:
    vbet_vb_exec_header_redirect($url); 
    9. save a file and test it.

    Already done - will be included in the next relase.
    Last edited by kamilkurczak; 28-02-11 at 09:32.

  4. #4
    Senior Member
    Join Date
    Jun 2010
    Posts
    276

    Default

    not sure the reason i still gte the 302 temp

    Status: HTTP/1.1 302 Moved Temporarily

  5. #5
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    Sorry, now you have a good solution in my previous post, please check it!

  6. #6
    Senior Member
    Join Date
    Jun 2010
    Posts
    276

    Default

    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?

  7. #7
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    can you explain me where you checked that you have a 302 redirect?

  8. #8
    vBulletin Enterprise Translator (vBET) Staff
    Join Date
    May 2010
    Posts
    1,000

    Default

    all changes are made.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •