Tuesday, October 17, 2006

Bowling for FrontPage users

Not everyone in your department has a license for Dreamweaver, and there are FrontPage users who want to edit pages on your server. All fine and dandy, except for one dreaded command in Internet Explorer: "Edit this page in Microsoft Office FrontPage."

If your pages are 100% HTML with no server-side includes or dynamically generated content, you can stop reading here and go back to watching those funny hamsters dance up and down. If you use a CMS that keeps people with FP away from it, likewise.

The rest of us are already tearing our hair out at the notion of someone replacing a carefully constructed framework page with static HTML once they're done changing a paragraph. See, IE merely passes the page's URL to FrontPage's Open File dialog, and then FP retrieves the code as if it were a browser -- because it is. Tell FP to open someone's phpinfo.php file, and the user agent will be Mozilla/4.0 (compatible; MS FrontPage 6.0). There's a solution.

In your .htaccess, add the following lines:

# Set a trap for people trying to edit pages from IE
SetEnvIf User-Agent FrontPage fpnono
Order Allow,Deny
Allow from all
Deny from env=fpnono