[TYPO3-english] RealUrl: Keep hyphen AND underscore
Torsten Schneider
schneider at highest-mountains.de
Sun Apr 11 16:43:46 CEST 2010
Hello,
I am using RealUrl for my project and set _ (underscore) as spaceCharacter.
But since I want to migrate an already exisiting project to TYPO3 and
this uses underscores as well as hyphens for some URLs I would like to
set RealUrl in a way that hyphens are not replaced by the spaceCharacter
but kept if I use them in the page title and / or the speaking path segment.
Example 1:
I have a page-title called Word-Word
at the moment this is changed to word_word.html
but the hyphen should not be replaced, so the URL should be word-word.html
Example 2:
I have a page with the title Word2 Word3
and the speaking path segment: word2-word3
The URL is changed to word2_word3.html but I want the hyphen to stay to
have word2-word3.html
Off course I can not simple choose - as Space Character since the old
page also has lots of pages with _ in the URL and they should stay, too.
I tried to change the
class.tx_realurl_advanced.php
and removed the - from
$processedTitle = preg_replace('/[ \+_]+/', $space, $processedTitle);
but this only results in Example 1 becoming wordword.html and Example 2
in word2word3.html
Does anyone have an idea how both characters can be secure from being
replaced?
Thank you very much in advance!
Torsten
More information about the TYPO3-english
mailing list