<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>howtos &#187; apache</title>
	<atom:link href="http://vinoaj.com/blog/category/howtos/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://vinoaj.com/blog</link>
	<description>my collection of howtos and code snippets</description>
	<lastBuildDate>Sun, 19 Oct 2008 03:52:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rewriting URLs to force www or non-www URLs</title>
		<link>http://vinoaj.com/blog/2007/04/rewriting-urls-to-force-www-or-non-www-urls/</link>
		<comments>http://vinoaj.com/blog/2007/04/rewriting-urls-to-force-www-or-non-www-urls/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 21:25:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/uncategorized/rewriting-urls-to-force-www-or-non-www-urls/</guid>
		<description><![CDATA[PLAIN TEXT
CODE:




#Activate the rewrite engine if it isn't so already


RewriteEngine on



#intercept all HTTP requests to the site that do not have a 'www.' at the beginning of the Domain name


#and then force a redirect to the same page address only this time, including the 'www.'


RewriteCond %{HTTP_HOST} !^www\..* [NC]


RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301]



#The inverse of the above [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#Activate the rewrite engine if it isn<span style="color:#CC0000;">'t so already</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">RewriteEngine on</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">#intercept all HTTP requests to the site that do not have a '</span>www.<span style="color:#CC0000;">' at the beginning of the Domain name</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">#and then force a redirect to the same page address only this time, including the '</span>www.<span style="color:#CC0000;">'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">RewriteCond %{HTTP_HOST} !^www<span style="color:#000099; font-weight:bold;">\.</span>.* [NC]</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301]</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">#The inverse of the above rule - intercept HTTP requests with a '</span>www.<span style="color:#CC0000;">' at the start and redirect to the non-www version</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;"># Ensure that your serverName directive is set up to the non-www name of your domain</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">RewriteCond %{HTTP_HOST} ^www<span style="color:#000099; font-weight:bold;">\.</span>.* [NC]</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">RewriteRule ^(.*) http://%{SERVER_NAME}/$1 [R=301] </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/04/rewriting-urls-to-force-www-or-non-www-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>htpasswd</title>
		<link>http://vinoaj.com/blog/2007/04/htpasswd/</link>
		<comments>http://vinoaj.com/blog/2007/04/htpasswd/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 05:05:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/howtos/htpasswd/</guid>
		<description><![CDATA[htpasswd is a command line tool for creating and updating user authentication files.  These files are primarily used by apache to authenticate HTTP users.
Creating a password file
PLAIN TEXT
CODE:




htpasswd -c /path/to/.htpasswd username 






Adding a user &#38; password
PLAIN TEXT
CODE:




htpasswd -b /path/to/.htpasswd username password 






]]></description>
			<content:encoded><![CDATA[<p><a href="http://httpd.apache.org/docs/1.3/programs/htpasswd.html" target="_blank">htpasswd</a> is a command line tool for creating and updating user authentication files.  These files are primarily used by apache to authenticate HTTP users.</p>
<p><strong>Creating a password file</strong></p>
<div class="igBar"><span id="lcode-5"><a href="#" onclick="javascript:showPlainTxt('code-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-5">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">htpasswd -c /path/to/.<span style="">htpasswd</span> username </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Adding a user &amp; password</strong></p>
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showPlainTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">htpasswd -b /path/to/.<span style="">htpasswd</span> username password </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/04/htpasswd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
