<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>The Front Lines</title>
	<link>http://wordfront.com/articles</link>
	<description>Articles and Tips about Web Design, Information Architecture, Application Programming, Databases, and the Internet</description>
	<pubDate>Thu, 16 Feb 2006 05:15:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
			<item>
		<title>T-Shirts For Sale by Word Front Wares</title>
		<link>http://wordfront.com/articles/2006/02/16/t-shirts-for-sale-by-word-front-wares/</link>
		<comments>http://wordfront.com/articles/2006/02/16/t-shirts-for-sale-by-word-front-wares/#comments</comments>
		<pubDate>Thu, 16 Feb 2006 05:15:13 +0000</pubDate>
		<dc:creator>Jough Dempsey</dc:creator>
		
	<category>Web Development</category>
	<category>Design</category>
	<category>Feuilleton</category>
	<category>Marketing</category>
		<guid isPermaLink="false">http://wordfront.com/articles/2006/02/16/t-shirts-for-sale-by-word-front-wares/</guid>
		<description><![CDATA[
 Word Front is proud to present our latest product offerings: t-shirts, apparel, and accessories via our Word Front Wares Store.
Each garment is hand-crafted out of only the finest organic and synthetic materials, and features an exciting and edgy graphic design that is sure to turn heads (and hearts).
All of our garments are professionally plot [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left;padding:0 .5em .5em 0"><img src="http://wordfront.com/images/designs/word.gif" alt="Word T-shirt Design" /></div>
<p> Word Front is proud to present our latest product offerings: t-shirts, apparel, and accessories via our <b><a href="http://wordfront.com/wares/">Word Front Wares Store</a></b>.</p>
<p>Each garment is hand-crafted out of only the finest organic and synthetic materials, and features an exciting and edgy graphic design that is sure to turn heads (and hearts).</p>
<p>All of our garments are professionally plot printed on high-quality heavyweight material that will withstand years of wearing and washing.  SpreadShirt is handling production and shipping.  We&#8217;re very excited about this new venture, and hope you&#8217;ll check out <a href="http://wordfront.com/wares/">our store</a>.</p>
<p>We&#8217;ll be adding new designs every Wednesday (more often throughout February) and will use this space to talk about new products and designs.
</p>]]></content:encoded>
			<wfw:commentRSS>http://wordfront.com/articles/2006/02/16/t-shirts-for-sale-by-word-front-wares/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Acquiring Our Own Sites</title>
		<link>http://wordfront.com/articles/2005/09/01/acquiring-our-own-sites/</link>
		<comments>http://wordfront.com/articles/2005/09/01/acquiring-our-own-sites/#comments</comments>
		<pubDate>Thu, 01 Sep 2005 22:58:12 +0000</pubDate>
		<dc:creator>Jough Dempsey</dc:creator>
		
	<category>Web Development</category>
	<category>Meta</category>
		<guid isPermaLink="false">http://wordfront.com/articles/2005/09/01/acquiring-our-own-sites/</guid>
		<description><![CDATA[While this is just part of the new company's re-structuring and has little effect on the sites we've built and operate, as of today Word Front officially owns <a href="http://poetryx.com">Poetry X</a>, <a href="http://joycean.org">Joycean.org: James Joyce</a>, and <a href="http://cinema-review.com">Cinema Review</a>.]]></description>
			<content:encoded><![CDATA[<p>While this is just part of the new company&#8217;s re-structuring and has little effect on the sites we&#8217;ve built and operate, as of today Word Front officially owns <a href="http://poetryx.com">Poetry X</a>, <a href="http://joycean.org">Joycean.org: James Joyce</a>, and <a href="http://cinema-review.com">Cinema Review</a>.</p>
<p>Expect updates, re-designs, and new content to be added to each of our sites soon.
</p>]]></content:encoded>
			<wfw:commentRSS>http://wordfront.com/articles/2005/09/01/acquiring-our-own-sites/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>How to Create Subdomains for Member Logins</title>
		<link>http://wordfront.com/articles/2005/08/10/how-to-create-subdomains-for-member-logins/</link>
		<comments>http://wordfront.com/articles/2005/08/10/how-to-create-subdomains-for-member-logins/#comments</comments>
		<pubDate>Wed, 10 Aug 2005 05:12:59 +0000</pubDate>
		<dc:creator>Jough Dempsey</dc:creator>
		
	<category>Web Development</category>
	<category>Programming</category>
	<category>Server Configuration</category>
		<guid isPermaLink="false">http://wordfront.com/articles/2005/08/10/how-to-create-subdomains-for-member-logins/</guid>
		<description><![CDATA[In this tutorial we show you how to create subdomains for your users so they can log in to a nicer-looking and easier to remember address, like username.example.com.]]></description>
			<content:encoded><![CDATA[<p>A nice feature to offer your visitors is their own little home page on your site, so that when they log in, instead of going to an awkward page like:</p>
<blockquote><p><code>http://example.com/members/profile.php?username=Bob</code></p></blockquote>
<p>They&#8217;re able to simply log in to:</p>
<blockquote><p><code>http://bob.example.com</code></p></blockquote>
<p>It&#8217;s easier for them to remember, and it looks nice and clean.  We&#8217;re all about clean livin&#8217; here at Word Front.</p>
<p>Numerous sites create this subdomain for you when you sign up for an account, like <a href="http://blogger.com">Blogger</a> does (pretty much all of our upcoming web applications will use this trick).  This tutorial will show you how to create wildcard subdomains and allow users to log in to your member account system (assuming you have one) using their own user name as a subdomain (like<code> http://username.example.com</code>).</p>
<p><a id="more-3"></a></p>
<ul>
<li>Here&#8217;s a link down the page for our &#8220;<a href="#quickWildcardSubdomains">Expert Mode Summary - Just the Nitty and Gritty</a>&#8221; if you&#8217;re already adept at configuring your web server.</li>
</ul>
<h3>Before We Begin</h3>
<p>First, for this tutorial we&#8217;re going to assume that you are using an Apache web server, Bind for <acronym title="Domain Name System">DNS</acronym>, and that you&#8217;re able to modify your web server and nameserver config files, which usually means that you&#8217;re running your own server and have root access.</p>
<p>If you&#8217;re using a shared hosting provider (you pay someone for some web space, and they set up everything on the server) then you should contact your web host or ISP to see if they offer &#8220;wildcard <acronym title="Domain Name System">DNS</acronym>&#8221; or &#8220;wildcard subdomains&#8221; for your account.  Yes, you&#8217;ll also need to have your own domain name (a la <code>example.com</code>), and a static <acronym title="Internet Protocol">IP</acronym> address (again, ask your provider) to create subdomains for your users.  While you&#8217;re asking your provider about wildcard subdomains, you can also make sure that the Apache module &#8220;mod_rewrite&#8221; is installed, as we&#8217;ll be using it to re-direct the right user to the right place.</p>
<p>In addition to all of the server setup stuff, you&#8217;ll need to know a little <acronym title="PHP Hypertext Preprocessor">PHP</acronym>, ASP, <acronym title="Java Server Pages">JSP</acronym>, PERL, or some other server-side scripting language to create the user login, which we won&#8217;t cover here.  If it sounds complicated, that&#8217;s because it is.  We&#8217;ll explain more below.</p>
<h3>First Step: Wildcard <acronym title="Domain Name System">DNS</acronym></h3>
<p>You&#8217;ll need to add a &#8220;wildcard&#8221; entry to the <acronym title="Domain Name System">DNS</acronym> zone for your server.  If your eyes just glazed over, don&#8217;t fret.  Most web server administration packages, like Cpanel and Plesk, offer a means of editing a <acronym title="Domain Name System">DNS</acronym> zone through a pretty browser interface.  </p>
<p>If not, though, you&#8217;ll need to open <code>named.conf</code> and add this line to the end of the <acronym title="Domain Name System">DNS</acronym> zone for the domain for which you want to enable wildcard domains:</p>
<blockquote><p><code>*.example.com. 14400 IN A 123.456.789.012</code></p></blockquote>
<p>Let&#8217;s break this down a little.  The asterisk (*) is the wildcard, and it&#8217;s telling the <acronym title="Domain Name System">DNS</acronym> system that ANY subdomain should point to your main account <acronym title="Internet Protocol">IP</acronym> (I used 123.456.789.012 as an example, but you should put your own <acronym title="Internet Protocol">IP</acronym> address here).</p>
<p>Note the period after the <code>example.com</code>.  That&#8217;s important.</p>
<p>Now save the config file and restart Bind (either from your web-based control panel or from your <acronym title="Secure SHell (encrypted protocol replaces telnet and FTP)">SSH</acronym> access while logged in as root - on most Linux servers it&#8217;s &#8220;service named restart&#8221; or &#8220;/etc/init.d/named restart&#8221;).</p>
<h3>Edit Apache&#8217;s VirtualHost Directives</h3>
<p>Okay, now we&#8217;re going to edit a line in Apache&#8217;s configuration file, <code>httpd.conf</code>.</p>
<p>Open <code>httpd.conf</code> in your favourite text editor (from the shell, change the directory to where <code>httpd.conf</code> is located, and then type &#8220;pico httpd.conf&#8221;) and scroll down, usually way way down, to where the VirtualHost directive is set up for your domain.  It should look something like this:</p>
<blockquote><p><code>&lt;virtualhost 123.456.789.012><br />
ServerAlias www.example.com example.com<br />
ServerAdmin webmaster@example.com<br />
DocumentRoot /home/example/public_html<br />
BytesLog domlogs/example.com-bytes_log<br />
ServerName www.example.com<br />
&lt;ifmodule mod_userdir.c><br />
Userdir disabled<br />
Userdir enabled example<br />
&lt;/ifmodule><br />
&lt;ifmodule mod_php4.c><br />
php_admin_value open_basedir "/home/example:/usr/lib/php:/usr/local/lib/php:/tmp"<br />
&lt;/ifmodule><br />
User example<br />
Group example<br />
CustomLog domlogs/example.com combined<br />
ScriptAlias /cgi-bin/ /home/example/public_html/cgi-bin/<br />
&lt;/virtualhost></code>
</p></blockquote>
<p>If you don&#8217;t have exactly those parameters, it&#8217;s probably because your server is set up differently than ours.  The important part is:</p>
<blockquote><p><code>ServerAlias www.example.com example.com</code></p></blockquote>
<p>We&#8217;re going to now add a new alias to match the new wildcard subdomain we added in Bind:</p>
<blockquote><p>
<code>ServerAlias www.example.com example.com <b>*.example.com</b></code>
</p></blockquote>
<p>This time there&#8217;s no period after the .com</p>
<p>Save <code>httpd.conf</code> and restart Apache (&#8221;service httpd restart&#8221;).</p>
<p>If all you wanted to do was to point <em>any</em> subdomain to your main index page, you&#8217;re done.   At this point <code>anything.example.com</code> will direct you to <code>example.com</code>.</p>
<h3>Getting Tricky: mod_rewrite</h3>
<p>Here&#8217;s where your hard work pays off.  Using the magic/voodoo of mod_rewrite, you can let users log in to your membership system using their own special subdomain on your server.</p>
<p>You can add the rewrite code right into <code>httpd.conf</code> but in case you need your web host to set up wildcard <acronym title="Domain Name System">DNS</acronym> for you, we&#8217;ll keep things flexible by adding the needed code in a file you can keep in your own web space (this way you can edit it anytime you want and you won&#8217;t interfere with other accounts on your server - and also you can edit this file without having to restart Apache, which is a bonus, especially if you&#8217;re experimenting and changing things a lot).</p>
<p>First, check to see if there&#8217;s a file called <code>.htaccess</code> in the root directory of your web site (usually <code>public_html/</code>).</p>
<p>If not, open your text editor (we like <a href="http://textpad.com">Textpad</a> but Notepad will do - you just can&#8217;t use a word processor like Word) and create a new plain text file called &#8220;<code>.htaccess</code>&#8221; (yes, with a leading dot - it&#8217;s an extension with no file name - in Windows you can put quotes around it when you save the text file so that Windows allows the filename-less file).</p>
<p>Add the following to your <code>.htaccess</code> file:</p>
<blockquote><p><code>RewriteEngine On<br />
RewriteRule ^\.htaccess$ - [F]<br />
RewriteCond %{HTTP_HOST} !^www\.example\.com?$<br />
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com?$<br />
RewriteRule ^$ /members/index.php [L]</code></p></blockquote>
<p>The first line turns on the <acronym title="Uniform Resource Locator">URL</acronym> rewriting engine.  </p>
<p>The second line doesn&#8217;t let people access your <code>.htaccess</code> file. You don&#8217;t really want people reading from (or writing to!) this file.  </p>
<p>The next two lines set up the conditions that will have to be met in order for the <acronym title="Uniform Resource Locator">URL</acronym> to be rewritten. </p>
<p>The third line allows the &#8220;<code>www.example.com</code>&#8221; subdomain to still work, while the third line matches every other subdomain.</p>
<p>The fourth line is where the redirection happens - any <acronym title="Uniform Resource Locator">URL</acronym> meeting the previous two conditions are redirected (quietly, without changing the <acronym title="Uniform Resource Locator">URL</acronym> text) to a <acronym title="PHP Hypertext Preprocessor">PHP</acronym> script.</p>
<p>You could alternately write the fourth line like:</p>
<blockquote><p><code>RewriteRule ^(.*)$ /members/index.php?userName=%1 [L]</code></p></blockquote>
<p>Then the <code>userName</code> GET variable will be sent to the  <code>index.php</code> script (or whatever server-side script you&#8217;re using).</p>
<p>Keep in mind that we&#8217;re not actually redirecting to another page from the user&#8217;s point of view - they&#8217;ll still see their <code>username.example.com</code> in their web browser.</p>
<p>Now any subdomain other than &#8220;<code>www.example.com</code>&#8221; will be redirected in the background to &#8220;<code>/members/index.php</code>&#8220;.</p>
<h3>Scraping the User Name</h3>
<p>In your script, you&#8217;ll be able to parse the user name based either on the <acronym title="Uniform Resource Locator">URL</acronym> string or the GET variable you&#8217;ve sent, and can present the user with a login form so they can log in.  You can even set the value of the user name input since you&#8217;re getting it from the <acronym title="Uniform Resource Locator">URL</acronym>.</p>
<p><b>NOTE</b>: You&#8217;re not actually authenticating a user based on just the <acronym title="Uniform Resource Locator">URL</acronym> string - you&#8217;re simply using your script to log them in as you ordinarily would, but instead of seeing a generic <acronym title="Uniform Resource Locator">URL</acronym> they&#8217;re seeing their own private <acronym title="Uniform Resource Locator">URL</acronym>.  </p>
<p>After logging them in you can set a cookie so that when they return to <code>http://username.example.com</code> they&#8217;re already logged in and presented with their start page (whatever that may be).</p>
<p>Here&#8217;s some sample <acronym title="PHP Hypertext Preprocessor">PHP</acronym> code to grab their user name from the subdomain string:</p>
<blockquote><p><code>&lt;?php</p>
<p>// Get <acronym title="HyperText Transfer Protocol">HTTP</acronym> request info<br />
$serverHost = explode( '.' , $_SERVER['HTTP_HOST']);</p>
<p>// Get subdomain<br />
$subdomain = $serverHost[0];</p>
<p>// Display it for test purposes<br />
echo "The subdomain is: " . $subdomain;<br />
?></code></p></blockquote>
<p>Give it a try.  You should be able to type in pretty much anything and see &#8220;The subdomain is: ______&#8221; on that page.</p>
<p>That&#8217;s it.  You&#8217;re now able to have your users log in to your site with their own subdomain!</p>
<h3 id="quickWildcardSubdomains">Expert Summary: Nitty &amp; Gritty</h3>
<p>If you&#8217;re already proficient with setting up Apache, Bind, and know <acronym title="PHP Hypertext Preprocessor">PHP</acronym> inside and out, here&#8217;s a briefer explanation of what you need to do.</p>
<p>For all steps replace &#8220;example.com&#8221; with your domain name, and &#8220;123.456.789.012&#8243; with your static <acronym title="Internet Protocol">IP</acronym> address (you&#8217;ll need one to set up wildcard <acronym title="Domain Name System">DNS</acronym>).</p>
<ol>
<li>Add <code>*.emample.com. 14400 IN A 123.456.789.012</code> to the <acronym title="Domain Name System">DNS</acronym> zone for your domain, then restart the nameserver.</li>
<li>Add the wildcard server alias to your web server&#8217;s config file, like <code>ServerAlias www.example.com example.com <b>*.example.com</b></code> - and then restart the web server.</li>
<li>Add the following to <code>.htaccess</code>:<br />
<blockquote><p><code>RewriteEngine On<br />
RewriteRule ^\.htaccess$ - [F]<br />
RewriteCond %{HTTP_HOST} !^www\.example\.com?$<br />
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com?$<br />
RewriteRule ^$ /members/index.php [L]</code></p></blockquote>
</li>
<li>Capture the user name with <acronym title="PHP Hypertext Preprocessor">PHP</acronym> or some other server-side scripting language, just for the sake of presentation, and NOT for actually authenticating the user.</li>
<li>Log them in as you ordinarily would.  The only difference now is that they see their custom subdomain page in the address bar rather than some awkward generic login page. Also, to access their account they can type an easier to remember <acronym title="Uniform Resource Locator">URL</acronym> rather than having to navigate your site, and if you set a cookie on login they&#8217;ll be able to get right to their data by setting a bookmark or returning to their private <acronym title="Uniform Resource Locator">URL</acronym>.</li>
</ol>
<p>Custom wildcard subdomains are especially useful if your web service offers a way for people to publically share their data with others.  For instance, if you had a site where people could share photos, their public photo sharing page could be username.example.com and people could direct their friends to that page to see their photos.</p>
<p>The possibilities are vast.</p>
<p>That&#8217;s it for this tutorial on setting up wildcard subdomains on your web server.  If you have any questions or suggestions, please leave a comment below.</p>]]></content:encoded>
			<wfw:commentRSS>http://wordfront.com/articles/2005/08/10/how-to-create-subdomains-for-member-logins/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>The Front Lines: Articles and Tips about Web Design, Information Architecture, Application Programming, Databases, and the Internet</title>
		<link>http://wordfront.com/articles/2005/08/09/articles-and-tips-about-web-design-information-architecture-application-programming-databases-and-the-internet/</link>
		<comments>http://wordfront.com/articles/2005/08/09/articles-and-tips-about-web-design-information-architecture-application-programming-databases-and-the-internet/#comments</comments>
		<pubDate>Tue, 09 Aug 2005 22:47:18 +0000</pubDate>
		<dc:creator>Jough Dempsey</dc:creator>
		
	<category>Web Development</category>
	<category>Meta</category>
		<guid isPermaLink="false">http://wordfront.com/articles/2005/08/09/articles-and-tips-about-web-design-information-architecture-application-programming-databases-and-the-internet/</guid>
		<description><![CDATA[With the recent launch of Word Front's new umbrella site, we've added this repository of articles, tips, and commentary about various aspects of web development, application design, programming, databases, information architecture, PHP, mySQL, XHTML, CSS, Javascript, Ajax, marketing,  and anything else that is part of an Internet professional's daily life.]]></description>
			<content:encoded><![CDATA[<p>With the recent launch of <a href="http://wordfront.com">Word Front</a>&#8217;s new umbrella site, we&#8217;ve added this repository of articles, tips, and commentary about various aspects of web development, application design, programming, databases, information architecture, <acronym title="PHP Hypertext Preprocessor">PHP</acronym>, mySQL, <acronym title="eXtensible HyperText Markup Language - HTML reformulated as XML">XHTML</acronym>, <acronym title="Cascading Style Sheets">CSS</acronym>, Javascript, <acronym title="Asynchronous Javascript And XML">Ajax</acronym>, marketing,  and anything else that is part of an Internet professional&#8217;s daily life.</p>
<p>Our aim is to keep our articles and examples as easy and simple to understand as possible, offering up tips we&#8217;ve collected over the past decade, with the intention of helping other designers make everything that falls under the big blanket of &#8220;web design&#8221; easier.</p>
<p>We hope to engender an environment of helpful sharing here, and to that end we encourage comments and discussion, even if it&#8217;s to disagree with us or point out the flaws in our work.</p>
<p>Expect this site to be updated a few times per week.  You can subscribe to our <acronym title="Rich Site Summary (an XML format for syndicating content)">RSS</acronym> syndication feeds if you want to be notified of updates.  Links are at the end of each archived article as well as in the footer of every page.</p>]]></content:encoded>
			<wfw:commentRSS>http://wordfront.com/articles/2005/08/09/articles-and-tips-about-web-design-information-architecture-application-programming-databases-and-the-internet/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
