私はrealurlをインストールしましたが、TYPO3のページにそれぞれのスピークURLパスセグメントでアクセスできますが、フロントエンドの自動生成リンクすなわちTMENU内)は、https://example.com/index.php?id=123
を指し、https://example.com/page-name
を指していません。TYPO3 7.6.10 realurl:ページはフロントエンドでアクセス可能ですが非静的リンク
私は、拡張マニュアルhttps://github.com/dmitryd/typo3-realurl/wiki/Notes-for-Integrators#my-urls-still-look-like-indexphpid12345-whats-the-problemでのFAQセクションを認識していますが、テンプレートに
config.tx_realurl_enable = 1
を追加する提案された解決策は、問題を解決していませんでした。
私は、パラメータL
が言語を運ぶように、通常の設定で複数言語設定をしています。また、正しい住所(例:https://example.com/en/page-name
)を手動で呼び出すときにも機能します。ここで
は私のセットアップの関連する部分です:
RealURLは拡張子が手動設定に設定されています。
<?php
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
'_DEFAULT' => array(
'init' => array(
'enableCHashCache' => 1,
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
'postVarSet_failureMode' => '',
),
'redirects' => array(),
'preVars' => array(
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'L',
'valueMap' => array(
'en' => '1',
),
'valueDefault' => 'en',
'noMatch' => 'bypass',
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 7,
'rootpage_id' => 1,
'firstHitPathCache' => 1,
),
'fixedPostVars' => array(),
'postVarSets' => array(
'_DEFAULT' => array(
// news archive parameters
'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',
),
),
),
// news pagebrowser
'browse' => array(
array(
'GETvar' => 'tx_ttnews[pointer]',
),
),
// news categories
'select_category' => array (
array(
'GETvar' => 'tx_ttnews[cat]',
),
),
// news articles and searchwords
'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' => '-',
),
),
),
array(
'GETvar' => 'tx_ttnews[backPid]',
),
array(
'GETvar' => 'tx_ttnews[swords]',
),
),
),
),
// configure filenames for different pagetypes
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 1,
'index' => array(
'print.html' => array(
'keyValues' => array(
'type' => 98,
),
),
'rss.xml' => array(
'keyValues' => array(
'type' => 100,
),
),
'rss091.xml' => array(
'keyValues' => array(
'type' => 101,
),
),
'rdf.xml' => array(
'keyValues' => array(
'type' => 102,
),
),
'atom.xml' => array(
'keyValues' => array(
'type' => 103,
),
),
),
),
),
);
?>
定数テンプレートの一部:
mod.SHARED {
defaultLanguageFlag = de.gif
defaultLanguageLabel = Deutsch
}
# Define some vars for use later on
baseURL = https://example.com/
german = 0
english = 1
# real URL config
config.baseURL = {$baseURL}
config.absRefPrefix = {$baseURL}
config.simulateStaticDocuments = 0
config.tx_realurl_enable = 1
config.uniqueLinkVars = 1
config.linkVars = L
config.prefixLocalAnchors = all
plugin {
tx_srstaticinfo.languageCode = DE
tx_srlanguagemenu {
showInactive = 1
showCurrent = 1
useSelfLanguageTitle = 1
languagesUidsList = 0,1
defaultLanguageISOCode = DE
defaultCountryISOCode = DE
}
}
SETUP部分(ここでの唯一の構成とメニュー部分が図示されている):
config.baseURL = {$baseURL}
### Configuration
## menu
lib.menu = HMENU
lib.menu.1 = TMENU
lib.menu.1 {
NO.allWrap = <li>|</li>
ACT = 1
ACT.wrapItemAndSub = <li class="ACT">|</li>
wrap = <ul class="menu">|</ul>
}
## language menu
plugin.tx_srlanguagemenu.settings {
useSysLanguageTitle = 0
defaultLanguageISOCode = DE
LanguageISOCode = DE
link.NO.stdWrap = |
hideIfNoAltLanguages = 1
#outputs a list (2: list, 1: selection list, 0:flag)
defaultLayout = 0
links.stdWrap.split.wrap >
_CSS_DEFAULT_STYLE >
}
# Building the page
# Default PAGE object:
page = PAGE
# Define the template
page.10 = TEMPLATE
# Our template is a file
page.10.template = FILE
page.10.template.file = fileadmin/template/index.html
# Insert stylesheet in the head of the website
page.stylesheet = {$baseURL}fileadmin/template/style.css
# Work with the subpart "DOCUMENT"
page.10.workOnSubpart = DOCUMENT
# Define the subparts, which are inside the subpart DOCUMENT
page.10.subparts {
# The subpart LANGMENU outputs a language selection widget
LANGMENU = HMENU
LANGMENU < plugin.tx_srlanguagemenu.widgets.menu
# The subpart CONTENTLEFT outputs the content of the left column
CONTENTLEFT = CONTENT
# Display the menu
CONTENTLEFT < lib.menu
[...]
}
[...]
# Setting up the language variable "L" to be passed along with links
config.linkVars = L
#values for default language
config.sys_language_uid = 0
config.language = de
config.locale_all = de_DE
# English language, sys_language.uid = 1
[globalVar = GP:L = {$english}]
config.sys_language_uid = 1
config.language = en
config.locale_all = en_GB
[global]
ありがとうございます!それが問題を解決しました! – user3482779