Question

Here is a snippet from my Realurl configuration:

'postVarSets' => array (
        '_DEFAULT' => array (
            'package' => array (
                '0' => array (
                    'GETvar' => 'packageid',
                ),
            ),

What does this code do? Does this retrieve a POST variable called package? And in the array there is a variable packageid?

I'm searching for a path element called package which redirects to a certain page, but I doesn't quite know how this works ..

Was it helpful?

Solution

The whole RealURL configuration is about telling RealURL how to encode/decode URLs. postVarSets is one of the configuration options that uses a keyword to identify a part of the URL.

In your case it tells RealURL that if there's a keyword package in the URL, the first thing that follows this keyword should be set as a GET variable packageid. So URL...

http://www.example.com/page-uid-1/package/123

...should be equivalent to...

http://www.example.com/index.php?id=1&packageid=123
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top