Welcome to WebmasterWorld Guest from 54.157.81.13

Forum Moderators: Robert Charlton & goodroi

Struggling with HTTPS Pre-head Tags

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

Preferred Member

5+ Year Member

joined:Mar 22, 2011
posts: 427
votes: 3


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.
2:06 pm on Sept 23, 2017 (gmt 0)

Senior Member

WebmasterWorld Senior Member aristotle is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Aug 4, 2008
posts:3262
votes: 239


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.
2:12 pm on Sept 23, 2017 (gmt 0)

Preferred Member

5+ Year Member

joined:Mar 22, 2011
posts: 427
votes: 3


@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">
5:20 pm on Sept 23, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14152
votes: 541


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.
7:12 pm on Sept 23, 2017 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:9869
votes: 515


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]

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

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:9869
votes: 515


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.
10:20 pm on Sept 23, 2017 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:882
votes: 87


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.
11:11 pm on Sept 23, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14152
votes: 541


<strong> and <b>
Insert boilerplate about difference between semantic and presentational markup.
11:17 pm on Sept 23, 2017 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:882
votes: 87


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.
12:24 am on Sept 24, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14152
votes: 541


<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>
12:58 am on Sept 24, 2017 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:882
votes: 87



<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">
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members