typo3 realurl仅显示url中的一个段
我在typo3中研究realurl,花了几个小时研究为什么typo3只显示url中的一个片段 站点结构如下所示: 我在“munchen Maistrase”子页面中得到的URL是: 我希望它是: 这是我的服务器.htaccess文件:typo3 realurl仅显示url中的一个段,url,url-rewriting,typo3,realurl,Url,Url Rewriting,Typo3,Realurl,我在typo3中研究realurl,花了几个小时研究为什么typo3只显示url中的一个片段 站点结构如下所示: 我在“munchen Maistrase”子页面中得到的URL是: 我希望它是: 这是我的服务器.htaccess文件: <FilesMatch "\.(js|css)$"> <IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 7 days"
<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
在我的根页面上。我已经用尽了解决方案。您需要自己的配置才能实现这一点 1) 在
扩展管理器中
->RealUrl
->配置
您必须禁用自动配置,并在其中定义您自己的RealUrl配置文件的路径
2) 您应该确保设置了(第页)。config.tx\u realurl\u enable=1
3) 为您的网站进行正确的realUrl配置后,您必须截断所有realUrl缓存表,或者删除所有ID到路径的映射
以下是标准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);
?>
检查页面“referezen”的页面属性中是否未设置“排除讲话URL”。否则,将您的RealURL配置发布为您发布的.htaccess配置,该配置在URL生成中不起任何作用。我已更改了“referencen”子页面的“排除”从说出URL,但没有发生任何问题,输入错误仍然显示URL中的最后一段。这里是截图:我不知道你所说的“改变”是什么意思。应该取消选择它。但请检查阿雷克·范沙克的答案。我从来没有使用过RealURL的默认配置,所以我不知道您提到的行为是否是默认的。如果是这样的话,那么简单地使用您自己的配置就可以了。class.tx\u realurl\u advanced.php:&tx\u realurl\u advanced->main可以做到这一点,所以您是对的,默认配置不能做到这一点。我该怎么做?我可以从typo3后端执行此操作,还是需要连接到数据库并手动删除它?感谢您的帮助。1)进入Web->Info
并在页面树中选择网站的根页面。2) 在上面的下拉菜单中选择RealURL管理
,并在页面上出现的第二个下拉菜单中选择ID到路径映射
,深度为inifite
。3) 在显示所有ID到路径映射的表格中,您可以通过位于表格标题中的垃圾箱图标将其删除。4) 清除所有缓存
它现在应该可以工作了!我已经做了所有提到的事情,它仍然是一样的。我已禁用realurl自动配置将您的realurl配置粘贴到配置文件中,确保onfig.tx\u realurl\u enable设置为1并删除ID到路径的映射。页面表中的所有realurl选项是否仍处于未选中状态?确保已加载realurl配置模板。您可以通过放置一个骰子(“foo”)来检查这一点;在配置文件的PHP中,然后清除缓存(“foo”应该出现在前端)。否则,您还应该尝试截断所有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);
?>