[phpBB3] Editing or Removing <BASE HREF>

Magic SEO URLs for phpBB.
redburn
Posts: 12
Joined: Sun Apr 24, 2011 8:06 am

[phpBB3] Editing or Removing <BASE HREF>

Postby redburn » Sun Apr 24, 2011 11:53 am

Is there any way to either remove or customize the BASE HREF tag that Magic SEO URLs automatically adds to my templates? I don't think I need it, and, as it is now, it is written in XHTML, whereas my document is HTML4.0. I've searched through the PHP files, but since they're decoded on the fly via Zend I cannot edit this in the source files. Perhaps I can override the inclusion of the tag somewhere, somehow?

inveo
Inveo Support
Posts: 1276
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby inveo » Sun Apr 24, 2011 12:28 pm

The base tag is required - otherwise phpBB3 will not work correctly.

This tag is XHTML compatible. You can check this forum which is also enhanced by Magic SEO URLs and you will get Valid XHTML as a result.

redburn
Posts: 12
Joined: Sun Apr 24, 2011 8:06 am

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby redburn » Wed Apr 27, 2011 4:04 am

This tag is XHTML compatible. You can check this forum which is also enhanced by Magic SEO URLs and you will get Valid XHTML as a result.

Absolutely. The problem, however, is that my templates have the HTML 4.01 doctype, not XHTML 1.0, so the formatting of the BASE tag is invalid. I understand why it is XHTML by default (i.e. <base href="" /> instead of <base href="">), since the default phpBB templates carry that doctype, but I was wondering if there was some way to override or remove it so that I can customize it to validate with my HTML 4.01 doctype.

inveo
Inveo Support
Posts: 1276
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby inveo » Wed Apr 27, 2011 8:10 am

redburn wrote:Absolutely. The problem, however, is that my templates have the HTML 4.01 doctype, not XHTML 1.0, so the formatting of the BASE tag is invalid. I understand why it is XHTML by default (i.e. <base href="" /> instead of <base href="">).


<base href="" /> (with / before > ) is valid for both HTML and XHTML doctypes.

redburn
Posts: 12
Joined: Sun Apr 24, 2011 8:06 am

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby redburn » Thu Apr 28, 2011 1:37 am

According to the W3C validator, it isn't.

The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.

You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include: using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character.

To get back to the question, however: since the script files are encoded, is there any way to alter the coding of the BASE tag?

inveo
Inveo Support
Posts: 1276
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby inveo » Thu Apr 28, 2011 9:44 am

The thing with slash is much more complicated than you can imagine and this is the reason why you can see special comment after this tag to work-around all cases.

Please post here your forum URL.

redburn
Posts: 12
Joined: Sun Apr 24, 2011 8:06 am

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby redburn » Sun May 01, 2011 1:35 pm

The forum is not live yet. Could you please tell me what the php variable is that sets and/or outputs the BASE tag in magic_seo_urls-53.php, so that I can override it?

inveo
Inveo Support
Posts: 1276
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby inveo » Mon May 02, 2011 8:52 am

Magic SEO URLs do not use any phpBB vars/functions/methods. It runs on top of phpBB.

Can you please post here at least your HTML source code of main forum page?

redburn
Posts: 12
Joined: Sun Apr 24, 2011 8:06 am

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby redburn » Tue May 03, 2011 7:35 am

I know it runs on top of phpBB, and I'd like to know what the variable is that outputs the BASE tag as it appears in my header as such:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<base href="http://www.example.com/" /><!--[if IE]></base><![endif]-->

Because your PHP files are encoded, I cannot figure out what the variable is called; it might be $basehref or or $base_href or $basetag, or whatever, I cannot tell from the source. If you can tell me what it is, I might be able to reset its contents so that the BASE tag is not added to all of my pages, and then I can add it to my templates myself and make it validate as HTML 4.01.

So, really the only thing I'm looking for is the name of the variable that outputs the BASE tag and inserts it into the page head after the TITLE tag.

inveo
Inveo Support
Posts: 1276
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [phpBB3] Editing or Removing <BASE HREF>

Postby inveo » Tue May 03, 2011 8:08 am

The base tag can not be removed. If you would remove it some way, almost complete phpBB would stop work for users. Please post your HTML source code.