Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Redirect TYPO3:使用打字脚本动态重定向到父页面_Redirect_Typo3_Typoscript_Http Redirect_Typo3 6.2.x - Fatal编程技术网

Redirect TYPO3:使用打字脚本动态重定向到父页面

Redirect TYPO3:使用打字脚本动态重定向到父页面,redirect,typo3,typoscript,http-redirect,typo3-6.2.x,Redirect,Typo3,Typoscript,Http Redirect,Typo3 6.2.x,我正在用typo36.2建立一个网站 我有以下页面结构: - Page Root (id=0) - Page A (id=1, alias=pagea) - Content 1 (id=3, alias=content1) - Detail 1 (id=5, alias=detail1) - Detail 2 (id=6, alias=detail2) - Content 2 (id=4, alias=content2)

我正在用typo36.2建立一个网站

我有以下页面结构:

- Page Root (id=0)
   - Page A (id=1, alias=pagea)
      - Content 1 (id=3, alias=content1)
         - Detail 1 (id=5, alias=detail1)
         - Detail 2 (id=6, alias=detail2)
      - Content 2 (id=4, alias=content2)
         - Detail 3 (id=7, alias=detail3)
    - Page B (id=2, alias=pageb)
      - Content 3 (id=4, alias=content3)
我正在使用realURL,因此为了访问id=5的页面,以下URL将是有效的:
web.site/pagea/content1/detail1

第二级的页面(如A页)继承其子级的内容(如内容1、内容2)。因此,“contentx”页面不应该是单独可浏览的,而应该重定向到它们的父页面(Page X),并将别名作为hashtag。因此,如果要打开
web.site/pagea/content1/
,它应该重定向到
web.site/pagea/#content1

我尝试访问数据库,并在重定向头中构建我个人的重定向URL,但它不会替换{}查询

[treeLevel = 2]
  config >
  config.additionalHeaders = HTTP/1.0 301 Permanent Redirect | Location: https://web.site/{levelfield:-2, alias}#{page:alias}
[end]
有人能解决这个问题吗


另外,将Contnet页面设置为快捷方式对我不起作用,因为它会松开标签,并要求为每个“Content#”-页面设置它

配置的数据类型additionalHeaders是
字符串
,因此尝试访问数据库或使用
配置中的常量无法工作,不幸的是。

您可能会在另一层上找到解决方案:
尝试在.htaccess中构建一个regexp,它标识具有两个以上路径段的URL,并使用锚将其重写/重定向到顶级

当你想在你的网站中有相同的链接时,你可能需要在页面生成中使用与上一次stdWrap相同的替换,这样每个“正常”的深度链接都会被第一手替换,而带有多路径段的URL则完全不为世界所知(谷歌)