Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Struggling with HTTPS Pre-head Tags

         

Pjman

3:08 am on Sep 23, 2017 (gmt 0)

10+ Year Member Top Contributors Of The Month



I'm switching my site to HTTPS this week, yeah cramming like college. I had the site designed for me and I have 2 pre-head tags that I don't know what to do with to get rid of mixed content.

Here they are:

1.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

2.

<html xmlns="http://www.w3.org/1999/xhtml">

Should I just switch them to:


<!DOCTYPE html>
<html lang="en">

Not sure, any input is much appreciated.

aristotle

2:06 pm on Sep 23, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It looks like the site is (or originally was) in xhtml format. You should run some of your pages through the W3C validators to see what they say before you make any changes to the Doctype specification.

Pjman

2:12 pm on Sep 23, 2017 (gmt 0)

10+ Year Member Top Contributors Of The Month



@aristotle
Good point. After my HTTPS migration I got some more work to do. I think I figured it out by looking at what other HTTPS sites are doing with that. In case it helps anyone else:

Just add the https protocol to the absolute links:

Switch:
[w3.org...]

to: [w3.org...]

and

<html xmlns="http://www.w3.org/1999/xhtml">

to

<html xmlns="https://www.w3.org/1999/xhtml">

lucy24

5:20 pm on Sep 23, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Apples and oranges. The <head> tags you name have nothing to do with protocol; they identify which dialect of html the page uses.

If a page uses HTML5, its DTD (Document Type Declaration) is the minimalist
<!doctype html>
But this is completely independent of whether the site is accessed by HTTP or HTTPS.

If the pages use XHTML 1.0, as implied by the existing <head>, leave it alone.

If you no longer know what dialect the pages are written in, run them through a validator and see what comes up.

keyplyr

7:12 pm on Sep 23, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I hope those two doctypes aren't on the same page. Should be only one doctype per page.

As Lucy24 said, the doctypes and the protocol the browser uses to negotiate with the server are unrelated.

If you change doctypes, you will likely need to edit a lot of code tags on every page. There's is no need to change doctypes when switching to HTTPS.

[edited by: phranque at 12:34 am (utc) on Sep 24, 2017]
[edit reason] typo [/edit]

keyplyr

8:48 pm on Sep 23, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



And BTW
Switch:
[w3.org...]

to: [w3.org...]

and

<html xmlns="http://www.w3.org/1999/xhtml">

to

<html xmlns="https://www.w3.org/1999/xhtml">

You do not need to do this either. Links in the HEAD (or pre head as you like to say) are not protocol dependent. However if you have scripts in the HEAD that deliver content or links to the BODY of the page, these do need to be HTTPS.

seoskunk

10:20 pm on Sep 23, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you are going to make a change (I personally would) then the most supported and forgiving for coding is definitely the html5 one

<!DOCTYPE html>
<html lang="en">

This has the added advantage of supporting XHTML code so you shouldn't need any code changes
<br> and <br /> are treated the same as is <strong> and <b> for instance.

lucy24

11:11 pm on Sep 23, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<strong> and <b>
Insert boilerplate about difference between semantic and presentational markup.

seoskunk

11:17 pm on Sep 23, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hey Lucy, when they were laying out the compatibility of html5 so webmasters could embrace it and not be stuck with abandoned XHTML code they matched strong to bold, I think search does the same.

lucy24

12:24 am on Sep 24, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<extreme topic drift>
The semantic <strong> is associated with the presentational <b> in the same way that semantic <em> is associated with presentational <i>. But it's ultimately a matter of fashion: If html had been developed 3-4 centuries earlier, <em> might have been rendered as small-caps instead. And if your body text is italic, <em> will be roman.

Some writing systems just aren't suited for italics, though I don't know if any browser has the nerve to render <em> in some other way, such as boldface, instead. If your primary text is in hiragana, is <strong> rendered as katakana? It should be, but I'll bet it isn't.
</etd>

seoskunk

12:58 am on Sep 24, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




<also off topic>
The idea of a semantic web markup with fatal errors for minor infractions caused the revolt against the w3c, most people fail to grasp these intricacies of code and had the w3c prevailed we would be looking at a broken web right now. Html5 (now just html) simplified semantics I agree but keeps the web open for everyone and it was a positive move supported by Google, Apple, Microsoft,Browsers and a host of others including eventually the W3c themselves. Yes there is some dumbing down of XHTML but it mapped inclusion of the obsolete code.
</end off topic>

Ok to the OP you should have no problem going ahead with the html5 tags and my advice is to do it;

<!DOCTYPE html>
<html lang="en">