1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[rewrite] ENV. variables inside RewriteRule

Discussion in 'Apache' started by marmz, Sep 1, 2016.

  1. #1
    So.. i have some rules likes this:

    RewriteRule ^(it|en|fr|de|es)/(.*)$ mz_site.php?lang=$1&url=$2 [L,QSA]


    Now, i'd like to store my "list of languages" inside a variable and use it when i need ..
    something like this:

    RewriteRule (.*) - [E=LANGS:it|en|fr|de|es]

    RewriteRule ^(%{ENV:LANGS})/(.*)$ mz_site.php?lang=$1&url=$2 [L,QSA]

    But the rule doesn't work :(

    I have made some test, passing LANGS to php script:

    RewriteRule ^(it|en|fr|de|es)/(.*)$ mz_site.php?lang=$1&url=$2&langs=%{ENV:LANGS} [L,QSA]


    the script gets the values in $_GET['langs']
    so, the variable LANGS is correctly set.

    What i need to make it work??
     
    marmz, Sep 1, 2016 IP