I converted a genealogical gedcom file to xhtml to post to my website. The file displays properly when loaded into Firefox or Chrome from my computer using file:///home/user/file.xhtml but when uploaded to my website and accessed as


both browsers merely list the contents as a text file. Is there any simple way to get the file to work from the web? Here are the first few lines of the file:

<?xml version="1.0" encoding="UTF-8"?>
        <html:html xmlns:html="http://www.w3.org/1999/xhtml"
        <html:meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
  • file:// is not available over IP. It is only available over another network type. – closetnoc Sep 7 '16 at 18:47
  • For this to work the way you expect, your file MUST be available to the web server within your website's web space. It cannot be anywhere else with one exception. You can create a symbolic link from your website to your file. – closetnoc Sep 7 '16 at 18:50
  • @closetnoc I have clarified my question. – John Wayland Bales Sep 7 '16 at 18:52
  • 2
    BTW- You should get an good answer soon enough! It is likely something simple such as a MIME or file association setting in Apache. You may need to restart it. Busy doing accounting... so I better pay attention. – closetnoc Sep 7 '16 at 18:56
  • 1
    "browsers merely list the contents as a text file" - As closetnoc suggests, this sounds like a mime-type issue. Your server may not know what mime-type to serve for a .xhtml file. Check the server response, you should be seeing application/xhtml+xml (as in the meta tag) if this is true XHTML. Also check to make sure this is valid XHTML. – MrWhite Sep 7 '16 at 19:16

... it's showing as Content-Type: text/plain.

Providing the file has validated successfully as XHTML/XML then (assuming you are on an Apache web server) you can try adding the following to the .htaccess file in the document root (or your server config, if you have access):

AddType application/xhtml+xml xhtml

(I assume all modern browsers understand XHTML these days?!)

  • XHTML, which is XML, is heavily used despite rumors of its demise. – Rob Sep 7 '16 at 20:21
  • I tried adding "AddType application/xhtml+xml xhtml" to .htaccess but that did not fix it. The XML checks as valid but not the xhtml which has many many errors according to an online xhtml checker. I'm using a plugin for a genealogical program which allegedly turns your genealogical data (gedcom format) into a xhtml file. I was posting it for the benefit of my relatives. I may just have them download the file and open it in their browsers offline since it displays properly that way. – John Wayland Bales Sep 8 '16 at 4:17

There is a lot of problems with Gedcom file conversion and web hosting.

Have you checked your export file sources to see if codes match original source codes?

Export done with UT-8 coding? Tried HTML export opposed to XHTML?

Some software is proprietary and will only work on your machine and the proprietary server. You mentioned in the uploaded file errors exist. Also see if links are pointing to different folders on your machine and not actually being uploaded.

You might want try a different convertor first. Here is a link to GED2www, which is free for mac and pc.


  • Thanks for the suggestion. I am currently searching for a different converter. The GED2www does not run on my system (linux) and the source code zip file appears to be corrupted or I would compile from scratch. However I am trying a couple of other programs and may try to run GED2www under wine. – John Wayland Bales Sep 9 '16 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.