[TYPO3-english] realurl (+ tt_news) and avoiding double slash in URL

Alex Tempara AlexTempara-199882 at yahoo.de
Fri Oct 14 14:21:30 CEST 2011


Hello List.

Do anyone of you know what i'm doing wrong here:
RealURL and tt_news are working fine. I'm just tuning the URL generation

What i want for tt_news article on page 'foo' is a URL like:
*  http://www.domain.tld/news/this-is-the-news-article.html

For the news archive on page 'bar' i'd like to have:
*  http://www.domain.tld/news/archive/2011/may.html

For categories i'd like to have either:
*  http://www.domain.tld/news/this-is-the-category.html  OR
*  http://www.domain.tld/news/category/this-is-the-category.html

The page are organized like this:
└─news      (pid:10, single-/list-view, category list page)
   └─archive (pid:12, archive-menu)




Well, with my realurl configuration i get a correct and nice URL for the 
news list(1) and news article(2):
(1)  http://www.domain.tld/news/
(2)  http://www.domain.tld/news/this-is-the-news-article.html

I even get a nice URL for the archive(3):
(3)  http://www.domain.tld/news/archive/2011/may.html

My problem is the category listing. I get this:
(4)  http://www.showroom.es/news//category/this-is-the-category.html


I tried now for hours to correct the double slash issue on this URL but 
either i'm blind or incompetent or both.

Please, please, can you throw a glance on my configuration?

Thanks a lot.


--snip--
<?php
// ...
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
	'init' => array(
		'enableCHashCache'       => true,
		'appendMissingSlash'     => 'ifNotFile,redirect[301]',
		'adminJumpToBackend'     => true,
		'enableUrlDecodeCache'   => true,
		'enableUrlEncodeCache'   => true,
		'emptyUrlReturnValue'    => '/',
		'postVarSet_failureMode' => '',
		'reapplyAbsRefPrefix'    => true
	),
	'redirects' => array(),
	'preVars' => array(
		array(
			'GETvar'   => 'no_cache',
			'valueMap' => array(
				'nc'   => 1
			),
			'noMatch' => 'bypass'
		) ,
		array(
			'GETvar'   => 'L',
			'valueMap' => array(
				''       => '0',
				'de'     => '1'
			),
			'noMatch'  => 'bypass'
		),
		array (
			'GETvar'   => 'type',
			'valueMap' => array (
				'print'  => '98'
			),
			'noMatch'  => 'bypass'
		)
	),
	'pagePath' => array(
		'type'              => 'user',
		'userFunc'          => 
'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
		'spaceCharacter'    => '-',
		'languageGetVar'    => 'L',
		'rootpage_id'       => 1,
		'segTitleFieldList' => 'tx_realurl_pathsegment,alias,title',
		'expireDays'        => 30
	),
	'fixedPostVars' => array(
// START fixedPostVars

		// tt_news article
		'article' => 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'      => '-'
					),
					'languageGetVar'        => 'L',
					'languageExceptionUids' => '',
					'languageField'         => 'sys_language_uid',
					'transOrigPointerField' => 'l18n_parent',
					'autoUpdate'            => 1,
					'expireDays'            => 180,
				)
			)
		),

		// tt_news archive
		'archive' => array(
			array(
				'GETvar'  => 'tx_ttnews[year]'
			),
			array(
				'GETvar'  => 'tx_ttnews[month]',
				'valueMap' => array(
					'january'   => '01',
					'february'  => '02',
					'march'     => '03',
					'april'     => '04',
					'may'       => '05',
					'june'      => '06',
					'july'      => '07',
					'august'    => '08',
					'september' => '09',
					'october'   => '10',
					'november'  => '11',
					'december'  => '12'
				),
				'noMatch' => 'bypass'
			),
			array(
				'GETvar'  => 'tx_ttnews[day]',
				'noMatch' => 'bypass'
			),
			array(
				'GETvar'  => 'tx_ttnews[pS]',
				'noMatch' => 'bypass'
			),
			array(
				'GETvar'  => 'tx_ttnews[pL]',
				'noMatch' => 'bypass'
			)
		),

		'10'  => 'article',
		'12'  => 'archive',

// END fixedPostVars
	),

	'postVarSets' => array(
		'_DEFAULT' => array(
// START postVarSets

	// tt_news
			// tt_news category
			'category' => array(
				array(
					'GETvar' => 'tx_ttnews[cat]',
					'lookUpTable' => array(
						'table'                 => 'tt_news_cat',
						'id_field'              => 'uid',
						// Google wants uniqueness for spidering
						#'alias_field'          => 'concat(title, " ", uid)'
						'alias_field'           => 'title',
						'addWhereClause'        => ' AND NOT deleted',
						'useUniqueCache'        => 1,
						'autoUpdate'            => 1,
						'useUniqueCache_conf'   => array(
							'strtolower'        => 1,
							'spaceCharacter'    => '-'
						)
					)
				)
			),
			// tt_news pagebrowser
			'page' => array(
				array(
					'GETvar' => 'tx_ttnews[pointer]'
				)
			),
			'pg' => array(
				array(
					'GETvar' => 'tx_ttnews[pg]'
				)
			),
			'news' => array(
				array(
					'GETvar' => 'tt_news'
				)
			),
			'back' => array(
				array(
					'GETvar' => 'tx_ttnews[backPid]'
				)
			),
			'nq' => array(
				array(
					'GETvar' => 'news_search[search_text]'
				)
			),
			'nqc' => array(
				array(
					'GETvar' => 'news_search[category][]'
				)
			),

// END postVarSets
		)
	),
	
// filenames
	'fileName' => array(
		'index' => array(
			'index.html' => array(
				'keyValues' => array(
					'type' => 0
				)
			),
			'_DEFAULT' => array(
				'keyValues' => array()
			)
		),
		'defaultToHTMLsuffixOnPrev' => true,
		'acceptHTMLsuffix' => 1
	)
);
?>
--snap--


More information about the TYPO3-english mailing list