Anchor in SEO html

Discussions about the phpBB3 Forum. How to get the best from this powerful script.
Note that there is no official support for phpBB3 here, a place to share more than to ask for.

Moderator: Moderators

Anchor in SEO html

Postby ronthai » Wed May 01, 2013 4:06 am


I am reasonably good with standard phpBB and am now changing over to SEO, great, better version.

Anyway, I have a small problem with anchor links in html (so not bbcode)

In the standard phpBB, I do NOT have this problem, so it is a SEO problem.

I have an anchor link that goes from the header to the footer on every page (index, viewforum and viewtopic)
I found that a standard html anchor link does not work correctly in SEO, since when on the viewforum and viewtopic (rewrite ofcourse to real urls) the anchor reloads the index page and goes to the anchor on the index (footer), instead of the anchor on the viewforum or viewtopic page. It should on any page just jump to the footer, without going back to the index.

So I wrote this to avoid that from happining:
Code: Select all
<!-- IF SCRIPT_NAME == "viewforum" --><a href="{U_VIEW_FORUM}#TOC">Navigation Links</a>
<!-- ELSEIF SCRIPT_NAME == "viewtopic" --><a href="{U_VIEW_TOPIC}#TOC">Navigation Links</a>
<!-- ELSE --><a href="#TOC">Navigation Links</a>
     <!-- ENDIF -->

anchor on index page - no problem
anchor on category (forum) page - no problem
anchor on topic page - no problem

PROBLEM: anchor on a viewforum (not category) page, instead of just jumping to the anchor link, it refreshes the page and the does the jump to the anchor link on the refreshed viewforum page.

Any idea's why and how to solve it?

Thanks, Ron
Posts: 20
Joined: Fri Mar 30, 2012 10:50 pm


Re: Anchor in SEO html

Postby HB » Wed May 01, 2013 8:36 pm

Just a guess, but does your page include a <base> tag? Something like this:

Code: Select all
<base href=""/>

It should be set to the forum root. Maybe you missed this part of the mod in overall_header.html?
Dan Kehn
phpBB SEO Team
phpBB SEO Team
Posts: 1504
Joined: Mon Oct 16, 2006 2:25 am

Re: Anchor in SEO html

Postby ronthai » Thu May 02, 2013 4:21 am

No, I checked all html files and no base tags in there.

To be clear, it is a 100% fresh 3.0.11 phpBB-SEO install, so no update from standard phpBB or anything.

There is however in the overall_header this {SEO_BASE_HREF} just under the <head> tag, which is something the standard phpBB does not have.

I tried to remove it, well clearly not an option, but also the apge still refreshes anyway.

It also adds this to the URL when it is refreshed after clicking on the anchor link,
but on other pages (the ones that do NOT refresh) it only adds the standard #TOC
Posts: 20
Joined: Fri Mar 30, 2012 10:50 pm

Re: Anchor in SEO html

Postby ronthai » Sat May 04, 2013 6:21 am

Apparently nobody has any idea's about this small hick-up and I am also at a loss on how to solve it, after days again trying many different things.

So to avoid this problem I have changed the anchor link to a small javascript anchor link, which solves all problems. :D

If any one needs it it can be found here: :!: ... cript.html

This also solves the original problem, so no extra <!-- IF
Posts: 20
Joined: Fri Mar 30, 2012 10:50 pm

Re: Anchor in SEO html

Postby Stephen26 » Sat May 04, 2013 9:49 am

Thanks for posting the solution!
I install and configure phpBB-SEO (and other mods) for a fair price and very fast. If you are interested simply send me a private message.
phpBB SEO Team
phpBB SEO Team
Posts: 426
Joined: Mon May 03, 2010 7:06 am

Return to phpBB Forum


  • Related topics
    Last post

Who is online

Users browsing this forum: No registered users and 18 guests