문제

I noticed that when using mod_pagespeed on my site it updates my internal links.

When I am on / then my navigation looks like:

<ul>
    <li><a href="foo/bar"></a></li>
    <li><a href="example"></a></li>
</ul>

But when I am on /foo the same navigation looks like:

<ul>
    <li><a href="bar"></a></li>
    <li><a href="/example"></a></li>
</ul>

And when I am on /example it looks like:

<ul>
    <li><a href="/foo/bar"></a></li>
    <li><a href="example"></a></li>
</ul>

Is there a way to stop this behaviour as it's breaking some JS that relies on the href attribute of each link.

도움이 되었습니까?

해결책

You can disable this feature by adding

ModPagespeedDisableFilters trim_urls

to your pagespeed.conf file. See https://developers.google.com/speed/docs/mod_pagespeed/filter-trim-urls for more details.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top