Search code examples
typo3realurltx-news

TYPO3 tx_news: How to remove “news” prefix from RealURL path


I have a problem. Does anybody know how to get rid of the news prefix from url ?

it is like this

http://www.example.com/**news**/detail/title-of-news/

and I would like to be like this

http://www.example.com/detail/title-of-news/

Or replace news word with diffrent "article" for example.


Solution

    1. place single view plugin on separate article page
    2. Use fixedPostVars (from RealURL docs) to shorten the url, read this answer to see the sample for tt_news (sorry I haven't now any sample for News + RU, but there's no problem with tuning this):

    Sample:

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