Yuechen Zhao [email protected] CS 50, Harvard University Agenda

ž Life After 50… ž Domain Names ž Hosting ž Cross Browser/Platform Compatibility ž Error Handling and Other Server Magic ž Performance Optimization ž Search Engine Optimization ž Good Resources Domain Names Domain Names

ž Registering for a — Godaddy.com — .com — Active-Domain.com — NetworkSolutions.com ž Name Servers ž WHOIS Hosting

ž Shared/VPN/Semi-Dedicated/Dedicated ž Popular Hosts — HostGator — DreamHost — MDDHosting — GoDaddy — Free ž Control Panels — CPanel — DirectAdmin — DreamHost Panel Hosting

ž How to choose? — Operating System ○ Server: Apache/LiteSpeed/other — Add-on Domains/Subdomains — Bandwidth — Disk Space — (MySQL) — Languages — Cron Jobs — FTP Accounts — SSL — SSH Hosting

ž Performance! — Uptime — Response Time — Pingdom.com — Host-tracker.com ž Support ž Reliability Whew! Cross-Browser Compatibility

ž , Mobile Firefox, Chrome, Mobile Chrome, Safari, Mobile Safari, Internet Explorer, Mobile Internet Explorer, Opera, Opera Mobile … ž AHHHHHHHHHHH!!

ž “Well, that HTML/CSS/Javascript worked! Great, let’s move on…” Principles of Cross-Browser Compatibility ž Use only standard HTML/CSS/ Javascript ž But then Javascript, many versions ○ Document.getElementsByClassName() ž CSS, many versions ○ -moz- ○ -webkit- ž !!! validator.w3.org !!! Solution?

ž Use libraries and frameworks — Help simplify standardization process — Bootstrap/Gumby 960/etc. — JQuery/Dojo/Prototype/MooTools/etc. ž Don’t code from scratch — WordPress — Joomla! — Drupal — SMF/MyBB/phpBB/VBulletin/IP.Board Solution #2

ž Test test test… ž Internet Explorer… — A little history with IE 6 ž Browser Screenshots to check CSS — browserlab.adobe.com — browsershots.org ž Browsers to check Javascript — Virtualization (e.g. Bootcamp, VMWare) — Spoon.net Errors!

ž 400 – Bad Request ž 401 – Unauthorized ž 403 – Forbidden ž 404 – Not Found ž 500 – Internal Server Error ž … .htaccess

ž Directory level configuration file that allows for decentralized management of configuration ž Controls — Cache Settings — URLs — Authentication — Blocking (IP addresses, domains, etc.) — MIME types (treat .zhao as code) — Error Responses! Error Handling!

ž ErrorDocument 404 /errors/ 404.php ž ErrorDocument 500 /errors/ 500.php

ž For more .htaccess magic, see http://www.javascriptkit.com/howto/ htaccess.shtml

Performance Optimization

ž Image Optimization — Adobe Photoshop — webresizer.com ž Minify code — See www.google.com — http://minify.avivo.si/ ž Speed up your scripts — Are you doing extra work? ž Optimize your tables — Indexes, etc. ž Caching ž CDNs (e.g. CS 50 CDN) — Cloudflare Search Engine Optimization

ž SEO à shrouded in mystery ž http://www.google.com/webmasters/ docs/search-engine-optimization-starter- guide.pdf ž Keep content fresh ž Deep links are important ž Accurate page titles ž No errors ž Fast load time Other Good Resources

ž Google Tools — Track errors, indexing of your site, etc ž Google Analytics — Track your visitor demographics and your site growth ž Google Apps ž Firebug / Web Developer Extension ž W3Schools Thanks! :)