title: TYPO3: Dynamically redirect to parent page with typoscript
body: <p>I'm in the process of building a website using TYPO3 6.2.</p>
  
  <p>I have the following page structure:</p>
  
  <pre><code>- 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)
  </code></pre>
  
  <p>I am using realURL, so in order to access page with id = 5, the following URL would be valid: <code>web.site/pagea/content1/detail1</code></p>
  
  <p>Pages in the second level (eg Page A) inherit the content of its children (eg Content 1, Content 2). So the "Content X" pages should not be individually browseable and instead redirect to their parent (Page X), with the alias as a hashtag. So if one were to open <code>web.site/pagea/content1/</code>, it should redirect to <code>web.site/pagea/#content1</code></p>
  
  <p>I tried accessing the DB and build my individual redirect URL in the redirect-header, but it doesnt replace the {} queries</p>
  
  <pre><code>[treeLevel = 2]
    config &gt;
    config.additionalHeaders = HTTP/1.0 301 Permanent Redirect | Location: https://web.site/{levelfield:-2, alias}#{page:alias}
  [end]
  </code></pre>
  
  <p>Anyone got a solution to this?</p>
  
  <p>P.S. Setting the Contnet-pages as a shortcut does not work for me, as it looses the hashtag and requires it to be set for each "Content #"-Page</p>