Realurl generates the page URIs from the page title. In a multidomain environment there happen to be some pages with the same title, like "contact" or "imprint". It seems as if realurl cannot discriminate those URLs:
http://www.domain1.com/contact/
http://www.domain2.com/contact/
They always lead to the first URL found in the realurl database table, in the example above "http://www.domain1.com/contact/". Is there a way to avoid this?
This is the reaurl configuration:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array(
'_DEFAULT' => array(
'init' => array(
'appendMissingSlash' => 'ifNotFile,redirect',
'emptyUrlReturnValue' => '/',
),
'pagePath' => array(
'rootpage_id' => '123',
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array(
'print' => array(
'keyValues' => array(
'type' => 98,
),
),
),
),
),
'www.domain1.de' => '_DEFAULT',
'domain1.de' => 'www.domain1.de',
'www.domain2.de' => '_DEFAULT',
'www.domain2.de' => array(
'pagePath' => array(
'rootpage_id' => '456',
),
),
'domain2.de' => 'www.domain2.de',
);
Generally, this means that rootpage_id settings is either incorrect or not set in your config. RealURL does not have any issues when you have the same titles for various domains as soon as you configured root page ids correctly.
This is the correct snytax:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
'init' => array(
'appendMissingSlash' => 'ifNotFile,redirect',
'emptyUrlReturnValue' => '/',
),
'pagePath' => array(
'rootpage_id' => '123',
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array(
'print' => array(
'keyValues' => array(
'type' => 98,
),
),
),
),
);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain1.tld'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['domain1.tld'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain1.tld'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain2.tld'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain2.tld']['pagePath']['rootpage_id'] = '456';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['domain2.tld'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain2.tld'];
The current realurl configuration can be found with the module "Configuration" -> $GLOBALS['TYPO3_CONF_VARS'. There it can be checked whether the realurl configuration file does what it is supposed to do.
Related
I'm using TYPO3 7.6 with a multidomain and multilanguage Website, you see the links below. I've one page tree and rootpage_id for all three languages!
First language is german (L=0, https://www.renosan.de/)
Second language is english (L=1, https://www.renosan.net/)
Third language is polish (L=2, https://www.renosan.pl/)
For every language I'm using an own top-level domain (de,net,pl). I've also insert the domain records at my root page (TYPO3-Backend List -> Rootpage -> Domain records)
If I'm clicking at the preview button (s. image), the preview opens in a new window with:
English: https://www.renosan.de/index.php?id=1&L=1
Polish: https://www.renosan.de/index.php?id=1&L=2
... but the content is still in the default language (german)! I need to change the TLD to change the Website language manually. It's not useful for my editors, because they aren't seeing the preview with one click.
Can someone explain the behaviour from TYPO3?
I also tried to login into Backend from .net or .pl, nothing happens. It's always the default preview. No special .htaccess entries ...
My TypoScript Setup
### default german
config {
linkVars = L(0-2)
uniqueLinkVars = 1
sys_language_mode = content_fallback
sys_language_overlay = hideNonTranslated
sys_language_uid = 0
language = de
locale_all = de_DE.UTF8
htmlTag_langKey = de
}
### english L=1
[globalString = IENV:HTTP_HOST = *renosan.net]
config {
baseURL = https://www.renosan.net/
sys_language_uid = 1
language = en
locale_all = en_GB.UTF8
htmlTag_langKey = en
}
[GLOBAL]
### polski L=2
[globalString = IENV:HTTP_HOST = *renosan.pl]
config {
baseURL = https://www.renosan.pl/
sys_language_uid = 2
language = pl
locale_all = pl_PL.UTF8
htmlTag_langKey = pl
}
[GLOBAL]
I have locate the problem with my individual realURL-conf. If I try it with the 'autoconf' from Ext:realURLthe preview from Backend works!
Here's my personal realURL-Configuration file:
<?php
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '3',
'rootpage_id' => 1,
'firstHitPathCache'=> 1
),
'init' => array(
'enableCHashCache' => 1,
'respectSimulateStaticURLs' => 0,
'postVarSet_failureMode' => '',
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
//'de' => '0',
'en' => '1',
'pl' => '2'
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
),
'fixedPostVars' => array(
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'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,
),
),
),
'42' => 'newsDetailConfiguration',
'43' => 'newsDetailConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass',
),
),
'tags' => 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' => '-',
),
),
),
),
'seite' => array(
array(
'GETvar' => 'tx_news_pi1[#widget_0][currentPage]',
),
),
// news archive parameters
'archiv' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][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',
),
),
),
),
),
);
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DOMAINS'] = array(
'encode' => array(
array(
'GETvar' => 'L',
'value' => '0',
'useConfiguration' => 'renosan.de',
'urlPrepend' => 'https://www.renosan.de'
),
array(
'GETvar' => 'L',
'value' => '1',
'useConfiguration' => 'renosan.de',
'urlPrepend' => 'https://www.renosan.net'
),
[
'GETvar' => 'L',
'value' => '2',
'useConfiguration' => 'renosan.de',
'urlPrepend' => 'https://www.renosan.pl'
],
),
'decode' => array(
'renosan.de' => array(
'GETvars' => array(
'L' => '0',
),
'useConfiguration' => 'renosan.de'
),
'renosan.net' => array(
'GETvars' => array(
'L' => '1',
),
'useConfiguration' => 'renosan.de'
),
'renosan.pl' => array(
'GETvars' => array(
'L' => '2',
),
'useConfiguration' => 'renosan.de'
),
)
);
?>
Thanks for your help .. I have still no solution for this TYPO3-Problem?! Is it a TYPO3-Bug? Is there a problem with my realURL-Configuration-File?
I think your conditions are wrong and TYPO3 gets so confused that the conditions are ignored completely.
it is not
[global string = ENV: HTTP_HOST = ...
but:
[globalString = ENV:HTTP_HOST = ...
On the other hand I assume your TYPO3 will also gets confused about domains and additional language parameter. For preview you need to be logged in into the BE (cookies are domain dependend). So a preview in another language is possible only with language parameter. Your configuration mixes domains and language parameter: if you start with www.renosan.de?L=1 your baseurl is changed.
My recommandation: Split the handling depending on domain and L-Param.
If you use RealURL: Look at this blog post. Here you can see how to config realURL to watch at the Domains to seperate languages.
After that, you dont need conditions about the domains. You can use the simple [globalVar = GP:L = x] conditions.
I have create a custom view from scratch in SugarCRM PRO 7.6 displaying only the text "Hello World" and placed that view inside a custom layout created to display that view.
With the modifications i have made i have suucceded in displaying the "Hello World" view inside my newly created layout but i am not succeded in displaying anything in the header pane available right over my custom view.
The folder structure of my layout and view is shown below:
All the four files along with their containg code are shown below:
helloworldlayout.js
({})
helloworldlayout.php
<?php
$viewdefs['Accounts']['base']['layout']['helloworldlayout'] = array(
'components' => array(
array(
'layout' => array(
'components' => array(
array(
'layout' => array(
'components' => array(
array(
'view' => 'helloworldview',
'primary' => true,
),
),
'type' => 'simple',
'name' => 'main-pane',
'span' => 8,
),
),
array(
'layout' => array(
'components' => array(
array(
'layout' => 'sidebar',
),
),
'type' => 'simple',
'name' => 'side-pane',
'span' => 4,
),
),
array(
'layout' => array(
'components' => array(
array(
'layout' => array(
'type' => 'dashboard',
'last_state' => array(
'id' => 'last-visit',
)
),
'context' => array(
'forceNew' => true,
'module' => 'Home',
),
),
),
'type' => 'simple',
'name' => 'dashboard-pane',
'span' => 4,
),
),
array(
'layout' => array(
'components' => array(
array(
'layout' => 'preview',
),
),
'type' => 'simple',
'name' => 'preview-pane',
'span' => 8,
),
),
),
'type' => 'default',
'name' => 'sidebar',
'span' => 12,
),
),
),
'type' => 'record',
'name' => 'base',
'span' => 12,
);
helloworldview.js
({})
helloworldview.hbs
<h1>Hello World</h1>
Finally I am accessing this Hello World view using:
<my_sugar_instance>/#Accounts/layout/helloworldlayout
Can any body guide me what are the best practices to configure the header pane highlighted in the image shown below:
The problem is that 'view' => 'helloworldview' is too nested within helloworldlayout.php. For example, if you use the following code as your helloworldlayout.php:
<?php
$viewdefs['Accounts']['base']['layout']['helloworldlayout'] = array(
'components' => array(
array(
'view' => 'helloworldview',
),
),
'type' => 'simple',
'name' => 'base',
'span' => 12,
);
Then you will observe that there's no space:
helloworld without spaces
Take a look at the following solution suggested by Tevfik Tümer
https://community.sugarcrm.com/thread/27826
I'm runnning Typo3 6.2.4 with RealURL 1.12.8 and News (tx_news) 3.0.1. Using the automatic configuration from RealURL rewrites the URLs for "normal" pages, but not for news. The generated links look like this:
index.php?id=5&tx_news_pi1%5Bnews%5D=4&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail&cHash=706379a0ef43d4020448c5193f865bf1
This is what automatic configuration gives me. I've just inserted the part from http://docs.typo3.org/typo3cms/extensions/news/Main/Administration/Realurl/Index.html. At the moment I'm not interested in creating a special kind of rewritten URL, I just want to get RealURL rewrite the news URLs. Once that's running, I think I'll get the rest figured out.
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
'_DEFAULT' =>
array (
'init' =>
array (
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => true,
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'emptyUrlReturnValue' => '/',
),
'pagePath' =>
array (
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'rootpage_id' => '1',
),
'fileName' =>
array (
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' =>
array (
'print' =>
array (
'keyValues' =>
array (
'type' => 98,
),
),
),
),
'postVarSets' =>
array (
'_DEFAULT' =>
array (
// EXT:news start
'news' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
),
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,
),
),
),
// EXT:news end
),
),
),
);
It turned out that my realurl_conf.php was correct, but the TypoScript configuration part was missing. As soon as I put those lines in the template setup of my root page, Typo3 started to rewrite the URLs:
config.absRefPrefix = /
config.tx_realurl_enable = 1
config.uniqueLinkVars = 1
# dont forget to set the allowed range - otherwise anything else could be inserted
config.linkVars = L(0-3)
Source:
http://wiki.typo3.org/Realurl/manual#TypoScript_configuration
http://docs.typo3.org/typo3cms/extensions/realurl/Realurl/Configuration/HandlingRelativeLinksWithSpeakingUrls/Index.html
I am running realURL 1.12.6 on TYPO3 4.5.26
I am used to realURL creating paths that contain the preVar also for the default language, like www.example.com/de/seite/ and www.example.com/en/page/
In one case, this is just not happening - or I think, only sometimes.
In most of the cases, I get www.example.com/seite/ and www.example.com/en/page/
Where can this be changed?
PS: Here's the beginning of my realurlconf:
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
'init' => array(
'enableCHashCache' => 1,
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
'respectSimulateStaticURLs' => 0,
//'postVarSet_failureMode'=>'redirect_goodUpperDir',
),
'redirects_regex' => array (
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'en' => '1',
),
'valueDefault' => 'de',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'no_cache' => 1,
),
'noMatch' => 'bypass',
),
),
If I use this configuration (valueDefault is set, noMatch not) then 404 error page is not triggered when calling urls like
www.domain.com/notexisting/someexistingpage/
or
www.domain.com/notexisting/
The 404 page is only triggered when calling urls like
www.domain.com/notexisting/alsonotexistingpage/
That means, realurl expects the first part of the url to be the language part (here: "notexisting") and if realurl can't map this key, it uses the "valueDefault". But I want the 404 to be triggered, how can I achieve this?
Edit: I've the solution now:
realurl config:
'GETvar' => 'L',
'valueMap' => array(
'en' => '0',
'de' => '1',
),
'noMatch' => 'bypass',
TypoScript config:
config.defaultGetVars.L = 0
config.linkVars = L
Remove 'noMatch' => 'bypass', from your preVar configuration. The GET-Parameter "L" is not set to "0" if you open "www.example.com", so then the noMatch just bypasses the preVar configuration. If you only set valueDefault, it should work fine.
I'm working on a website that is made in typo3. I'm doing a part of the website that is made by somebody else, so I don't know that much of typo3.
This website uses realurl to translate the url to a readable one. How can I make a realurl? When I make like for example the index page there is no realurl made for this page. How could I generate one?
First of all, check the manual of realurl :
http://typo3.org/extensions/repository/view/realurl/current/
http://typo3.org/documentation/document-library/extension-manuals/realurl/1.10.2/view/
Check if RealUrl is enabled via TypoScript.
Check if links are generated with TYPO3 API / TypoScript.
Use RealUrl configurators
http://typo3.org/extensions/repository/view/cbrealurl/current/
Dmitry got more relevant tutorials about RealURL:
http://www.dmitry-dulepov.com/2008/05/realurl-made-easy-part-1.html
http://www.dmitry-dulepov.com/2008/06/realurl-made-easy-part-2.html
RealURL will be very easy to understand when you'll make it work with default configuration and understand the meaning of parts: 'init', 'preVars', 'postVarSets', 'pagePath', 'fixedPostVars' and 'fileName'.
Copy my configuration
typoscript in setup:
config.simulateStaticDocuments = 0
config.baseURL = /
config.tx_realurl_enable = 1
config.uniqueLinkVars = 1
config.absRefPrefix = http://www.ceisufro.cl/
page.config.language = cl
config.sys_language_uid= 0
config.useSysLanguageTitle = 1
config.language= es
config.language_alt= es
config.htmlTag_langKey= es
config.linkVars = L
config.sys_language_overlay = 1
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml"
xml:lang="es" lang="es"*
In file localconf.php
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
'www.ceisufro.cl'=> array(
'init' => array (
'enableCHashCache' => '1',
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => '1',
'enableUrlEncodeCache' => '1',
),
'redirects' => array (
),
'preVars' => array(
'0' => array(
'GETvar' => 'L',
'valueMap' => array(
'es' => '1',
'en' => '0',
'it' => '4',
),
'noMatch' => 'bypass',
'valueDefault' => 'es',
),
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => '1',
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '3',
'rootpage_id' => '1',
), 'fileName' => array (
'index' => array (
'rss.xml' => array (
'keyValues' => array (
'type' => '100',
'id' => '37'
),
),
'contacto.xml' => array (
'keyValues' => array (
'id' => '666',
'no_cache'=>'1'
),
),
)),
'fixedPostVars' => array(
),
),
);
go to ext manager, find the ext realurl and add the following configurations
check Enable automatic configuration
select Serializable in Automatic configuration file format
check Enable devLog
I wait to can help somebody