2

I have a realurl configuration which includes:

    'postVarSets' => array(
...
        '96' => array(
                'name' => array (
                    array(
                        'GETvar' => 'person',
                    ),
                ), 
            ),      
    )

This maps a URL like http://mydomain/name/knight to the GET parameter "person=knight"

However, if I try with http://mydomain/name/g.knight it fails. "g.knight" seems to be interpreted as the name of a file which does not exist. I cannot see the solution. Any ideas?

  • Does 'person=g.knight' works? – common sense Apr 15 '15 at 10:11
  • 1
    Yes, that works. I have just experimented some more and I discover that if I set init->appendMissingSlash = 1 then my problem goes away. As long as that does not cause problems elsewhere on the site then I guess I have a solution. Thanks for your interest. – Graham Knight Apr 16 '15 at 14:54
  • Please add this as an answer to your own question. – Michael Apr 21 '15 at 07:42

2 Answers2

1

I have just experimented some more and I discover that if I set init->appendMissingSlash = 1 then my problem goes away. As long as that does not cause problems elsewhere on the site then I guess I have a solution.

0

With the solution to always append a missing slash (not using 'ifNotFile'), you might run into problems when you want to provide a PDF File for download. e.g.

If the 'person' object is coming from your own ext, consider adapting this cal real_url conf snippet:

'fixedPostVars' => array(
        'calSingleView' => array(
            array(
                'GETvar' => 'tx_cal_controller[uid]',
                'lookUpTable' => array(
                    'addWhereClause' => ' AND NOT deleted',
                    'alias_field' => 'title',
                    'id_field' => 'uid',
                    'table' => 'tx_cal_event',
                    'useUniqueCache' => 1,
                    'useUniqueCache_conf' => array(
                        'spaceCharacter' => '-',
                        'strtolower' => 1,
                    ),

The settings in useUniqueCache_conf result in removing any special characters when generating the URI (including the dot). That way you would get http://mydomain/name/gknight circumventing your problem.

Hafenkranich
  • 1,696
  • 18
  • 32
  • Thanks for the suggestion. Do I understand that removal of special characters is a side-effect of setting 'useUniqueCache' => 1? Is that documented somewhere? – Graham Knight Apr 27 '16 at 18:27
  • Didn't find it specified in the real_url online documentation in detail. Inside `ext/realurl/Classes/Controller/Encoder/UrlEncoder.php` in function `cleanUpAlias()` there is a call to `ext/realurl/Classes/Utility.php` -> `convertToSafeString()`. There you will find the regexes applied. – Hafenkranich Apr 28 '16 at 15:32