• Hi,
    it seems that private (= user defined) variables are excluded from rewriting.

    this code:


    //testing code for Polyglot plugin
    add_filter('rewrite_rules_array', 'polyglot_generate_rewrite');

    $polyglot_rewrite_tag = '%lang%';
    $polyglot_query_var = 'lp_lang_view';
    $polyglot_link_base = 'lang';

    function polyglot_generate_rewrite($rewrite) {
    global $polyglot_rewrite_tag, $polyglot_query_var, $polyglot_link_base,$wp_rewrite;

    $wp_rewrite->add_rewrite_tag($polyglot_rewrite_tag, '([^/]{2,2})', "{$polyglot_query_var}=");
    $structure = $wp_rewrite->root . $polyglot_link_base . "/{$polyglot_rewrite_tag}/%post_id%";
    $rules = $wp_rewrite->generate_rewrite_rule($structure);

    return ($rules + $rewrite);
    }

    creates proper rules in $wp_rewrite object and they work but varible $_REQUEST[‘lp_lang_view’] is not set:( Is it bug? Do you know any workaround?

Viewing 1 replies (of 1 total)
  • Not sure, if this is on the same topic but I am
    trying to use polyglot rewrite as described in
    the polyglot.php, i.e.:
    RewriteRule ^(.*)/xx/?$ /$1?lp_lang_view=xx [QSA]

    I have added:
    RewriteRule ^(.*)/de/?$ /$1?lp_lang_view=de [QSA]e
    to my .htaccess.
    However it doesn’t seem to rewrite the ‘deutsch’ language link.

    I am using the standard Permalink Structure:
    /%year%/%monthnum%/Úy%/%postname%/

    thanks for any help.

Viewing 1 replies (of 1 total)
  • The topic ‘Private variables don’t work with rewrite rules’ is closed to new replies.