<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Dave Dash</title>
 <link href="http://davedash.com/tag/rewrite/atom.xml" rel="self"/>
 <link href="http://davedash.com/tag/rewrite"/>
 <updated>2010-08-29T14:12:50-07:00</updated>
 <id>http://davedash.com/</id>
 <author>
   <name>Dave Dash</name>
   <email>dd+atom1@davedash.com</email>
 </author>

 
 <entry>
   <title>nginx and 'www' free urls</title>
   <link href="http://davedash.com/2008/01/19/nginx-and-www-free-urls/"/>
   <updated>2008-01-19T00:00:00-08:00</updated>
   <id>http://davedash.com/2008/01/19/nginx-and-www-free-urls</id>
   <content type="html">&lt;p&gt;[tags]nginx, rewrite[/tags]&lt;/p&gt;

&lt;p&gt;I'm not a fan of 'www' in urls and I've been flirting with nginx (pronounced Engine-X as much as I want to call it N-jinx).&lt;/p&gt;

&lt;p&gt;Here's a one-liner that'll rewrite your urls:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# rewrite hostname
server {
  server_name www. mydomain.com;
  rewrite ^/(.*) http://mydomain.com/$1 permanent;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I put this at the end of the definition for &lt;code&gt;mydomain.com&lt;/code&gt;.&lt;/p&gt;
</content>
 </entry>
 

</feed>
