I'm having trouble removing /news/story/ from my URL's when using ext:news and real url.
What I'd like is:
www.mysite.com/en/news/this-is-my-story-title
And not:
www.mysite.com/en/news/story/this-is-my-story-title
Current page structure:
-root(1)
--Home (2)
--News (3)
---Story (4)
This is my manual realurl conf:
<?php
$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment';
$domain = 'mysite.com';
$rootPageUid = 1;
$rssFeedPageType = 9818; // pageType of your RSS feed page
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$domain] = [
'pagePath' => [
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '3',
'rootpage_id' => $rootPageUid,
'firstHitPathCache' => 1
],
'init' => [
'enableCHashCache' => true,
'respectSimulateStaticURLs' => 0,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => true,
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'emptyUrlReturnValue' => '/',
],
'fileName' => [
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => [
'feed.rss' => [
'keyValues' => [
'type' => $rssFeedPageType,
]
]
]
],
'preVars' => array(
0 => array(
'GETvar' => 'L',
'valueMap' => array(
'en' => 0,
'cy' => 1,
),
'noMatch' => 'bypass',
),
),
'fixedPostVars' => array(
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'story' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'news' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
)
)
),
'newsCategoryConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
'newsTagConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
'4' => 'newsDetailConfiguration', // ID of the page with the news plugin detail view
),
'postVarSets' => [
'_DEFAULT' => [
'controller' => [
[
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass'
],
[
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass'
]
],
'dateFilter' => [
[
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
],
[
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
],
],
'page' => [
[
'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
],
],
],
],
];
Using TYPO3 v8.7.15,RealURL 2.3 and News v7.0.4
RealUrl is set to use my manual conf file also.
Thanks again T3 community
realUrl Provide pretty nice option to exclude a page from URL segment. For that go to Page-> property->General
. You will find an option Exclude from speaking URL
check this Screenshot.
In your case go to story
page and exclude this from URL
-root(1)
--Home (2)
--News (3)
---Story (4) // Exclude from realUrl
That's it, this what you're actually looking for!
Greetings!