The PHP parse error

How to prevent it

iWeb publishes its pages with this code at the beginning of each page:
  1. <?xml version="1.0" encoding="UTF-8"?>

Unfortunately, the webhost gives a PHP error because it is misconfigured.

Quite often you will not see an error message, but instead you will just get a blank page.


To make it work with iWeb you have to add a htaccess file in the public_html folder.

Create a plain-text text file and type : php_flag short_open_tag off

Save the file as htaccess (no extension like .txt or .doc ).

Copy it to the root (= public_html folder) of your webserver with a FTP application.

Cyberduck is a good choice.

Rename the htaccess file to .htaccess (notice the DOT before the name).

Depending on your Cyberduck settings the file will disappear from view.

Make it visible with the Show Hidden Files (Cmd-Shift-R) Command.

Note : If you run your own webserver you can edit the php.ini file in /private/etc/.

Find the line with short_open_tag = On and change it to Off.

Sources : Apache htaccess


Strange characters

When, after publishing or uploading your webpages, you see strange characters (•) on your page, then your webserver is ill-configured.

To solve it, add this code (without the linenumbers) to the htaccess file you may have created earlier.

  1. AddDefaultCharset UTF-8 or

  2. AddCharset UTF-8 .html and/or

  3. AddDefaultCharset Off

In addition to other htaccess directives, your htaccess file will look like this


Source : Fixing Strange Characters on iWeb Pages