Opened 8 years ago

# Only links to anchor on main page

Reported by: Owned by: anonymous normal TocMacro normal 0.11

### Description

I have trac installed under https://www.example.com/trac.

On the WikiStart I use Toc Macro like this:

[[TOC(heading=Documentation,TechDoc/Basic,TechDoc/Advanced)]]


Now, if I navigate to /trac the links in the TOC point to, for example, /trac#someanchor, instead of /trac/wiki/TechDoc/Basic#someanchor.

If I navigate to /trac/wiki the links are just fine.

I'm using apache2 with mod_python.

### comment:1 Changed 8 years ago by g.parrondo@…

• Cc anonymous added; g.parrondo@… removed

I was just investigating and discovered that:

• The problem doesn't occur with tracd.
• The problem doesn't occur if I access /trac/ instead of /trac

The latter makes me think that it's not a TocMacro problem.

As a temporary workaround I'm using a RedirectMatch in my apache:

<Location /trac>
RedirectMatch ^(/trac)1/
...
</Location>


Altough it's unclean.

### comment:2 Changed 6 years ago by dnedelchev

This is the same issue as the #6345 where a small patch is proposed. Please take a look at it too. I also think the summary of #6345 is more informative than this one.

I confirm the problem persist with Trac 0.12 too.

BTW it seems TocMacro current latest version (for 0.11, last modified in 2008) runs with 0.12 just like it did with 0.11 so I'm happy I can continue to use it after moving from Trac 0.11 to 0.12

### comment:3 Changed 16 months ago by rjollos

• Owner coderanger deleted