簡體   English   中英

typo3 realurl僅顯示網址中的一個細分

[英]typo3 realurl show only one segment in url

我在typo3中研究realurl,並花了幾個小時弄清楚為什么typo3在URL中僅顯示一個片段。

網站結構如下:

在此處輸入圖片說明

我從“ munchen-maistrasse”子頁面獲得的URL是:

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

我希望它是:

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

這是我的服務器.htaccess文件:

<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 

我在打字稿中不使用config.baseURL:

config.absRefPrefix = /
config.prefixLocalAnchors = all

在我的根頁面上。 我用光了解決方案。

您需要自己的配置才能達到此目的。

1)在Extension Manager -> RealUrl > Configuration您必須禁用自動配置並在其中定義您自己的realUrl配置文件的路徑。

2)您應確保該(頁面)。 設置config.tx_realurl_enable = 1

3)為您的網站進行正確的realUrl配置后,您必須截斷所有realUrl緩存表,或者只是刪除所有ID to Path mappings

以下是標准realUrl配置模板的一些示例:

<?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);
?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM