0

I was working on realurl's in typo3 and spend hours on working out why typo3 is showing only one segment in url.

site structure looks like this:

enter image description here

and URL that I got for subpage 'munchen-maistrasse' is:

http://www.bernd-gruber.at/munchen-maistrasse/

I want it to be:

http://www.bernd-gruber.at/referenzen/munchen-maistrasse/

This is my server .htaccess file:

<FilesMatch "\.(js|css)$">
  <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresDefault "access plus 7 days"
  </IfModule>
  FileETag MTime Size
</FilesMatch>

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
RewriteRule ^typo3$ typo3/index_re.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]

</IfModule>

AddType video/x-m4v .m4v
AddType video/ogg .ogv
AddType video/webm .webm
AddType video/x-m4v .m4v
AddType application/ogg .ogg 

I dont use config.baseURL in typoscript I use:

config.absRefPrefix = /
config.prefixLocalAnchors = all

on my root page. I have runned out of solutions.

strongBAD
  • 331
  • 2
  • 11
  • Check that the page "Referenzen" does NOT have "Exclude from speaking URL" set in its page properties. Otherwise post your RealURL configuration as the .htaccess configuration that you posted doesn't play any role in the URL generation. – tmt May 09 '13 at 07:46
  • I have changed Exclude from speaking URL for 'Referenzen' subpage, but nothing happend, typo is still displaying last segment in url. Here's screenshoot: http://i.imgur.com/xQdTcd4.jpg – strongBAD May 09 '13 at 09:15
  • I don't know what you mean by "changed". It should be UNSELECTED. Check Arek van Schayk's answer though. I have never used RealURL's default configuration so I don't know if the behaviour you refer to is a default one. If it is, then simply coming up with your own config should do the trick. – tmt May 09 '13 at 09:47
  • class.tx_realurl_advanced.php:&tx_realurl_advanced->main does do the trick, so you're right the default configuration cant do that – Arek van Schaijk May 09 '13 at 11:11

1 Answers1

1

You need your own configuration to reach this.

1) In the Extension Manager -> RealUrl -> Configuration you have to disable the automatic configuration and define there the path to your own realUrl configuration file.

2) You should make sure that (page).config.tx_realurl_enable = 1 is set.

3) After making the right realUrl configuration for your website you have to truncate all realUrl caching tables or just remove all ID to Path mappings.

Here some example of a standard realUrl configuration template:

<?php
$realurl_template = array(

    'init' => array(
        'appendMissingSlash'    =>  'ifNotFile,redirect',
        'enableCHashCache'      =>  1,
        'enableUrlDecodeCache'  =>  1,
        'enableUrlEncodeCache'  =>  1,
        'emptyUrlReturnValue'   =>  '/'
    ),

    'preVars' => array(
        array(
            'GETvar'    =>  'no_cache',
            'valueMap'  =>  array(
                'nc'    =>  1,
            ),
            'noMatch'   =>  'bypass',
        ),
    ),

    'fileName' => array(
        'index' => array(

        ),
    ),

    'postVarSets' => array(
        '_DEFAULT' => array (

        ),
    ),

    'pagePath' => array(
        'type' => 'user',
        'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
        'spaceCharacter' => '-',
        'languageGetVar' => 'L',
        'expireDays' => 3,
    )
);

# Configurate domain names
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
    '_DEFAULT' => $realurl_template,
    'domain.com' => $realurl_template,
    'www.domain.com' => $realurl_template,
);

$TYPO3_CONF_VARS['EXTCONF']['realurl']['domain.com']['pagePath']['rootpage_id'] = 1;
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain.com']['pagePath']['rootpage_id'] = 1;

# Unset template
unset($realurl_template);
?>
Arek van Schaijk
  • 1,432
  • 11
  • 34
  • How can I do #3? Can I do it from typo3 backend, or do I need to connect to database, and remove it manually? Thanks, for your help. – strongBAD May 09 '13 at 10:52
  • 1) Go to `Web->Info` and select the `root page` of your website in the pagetree. 2) Select in the above pull down `RealURL management` and in the second pull down that appear on the page the `ID-to-path mapping` with a depth of `inifite`. 3) In the table wich shows al ID-to-path mappings can you remove it by the `trash icon` located in the table header. 4) `Clear all caches` and it should work now! – Arek van Schaijk May 09 '13 at 11:05
  • I've done all mentioned things and it's still the same. I've disabled realurl automatic configuration paste your realurl configuration into the config file, made sure that onfig.tx_realurl_enable is set to 1 and delete ID to Path mappings. – strongBAD May 09 '13 at 11:22
  • Are all realurl options in the page table still unchecked? Make sure your realurl configuration template is loaded. You can check this by placing a die('foo'); in the PHP of the configuration file and after that clearing the caches (the 'foo' should then appear on the front-end). – Arek van Schaijk May 09 '13 at 11:27
  • Otherwise you should also try to `truncate all realurl tables` and try it again. – Arek van Schaijk May 09 '13 at 11:31
  • Now after trunkating all realurl tables it's finally working. Thank you very much Arek, Ive been working on it for days. I will buy you a beer if you come visit Wrocław (Poland), cheers mate! – strongBAD May 09 '13 at 11:34
  • No thanks! Now you should solve your 404 page (see http://www.bernd-gruber.at/unexisting-page/). See the Install tool -> All Configuration `[pageNotFound_handling]`. Fill there 404 and define the 404 page in your tree :) – Arek van Schaijk May 09 '13 at 11:42