<?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>MrBrown blob &#187; http</title>
	<atom:link href="http://charles.lescampeurs.org/category/http/feed" rel="self" type="application/rss+xml" />
	<link>http://charles.lescampeurs.org</link>
	<description>random bits.</description>
	<lastBuildDate>Thu, 02 Feb 2012 14:34:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Permanent redirect with nginx</title>
		<link>http://charles.lescampeurs.org/2009/03/20/permanent-redirect-with-nginx?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=permanent-redirect-with-nginx</link>
		<comments>http://charles.lescampeurs.org/2009/03/20/permanent-redirect-with-nginx#comments</comments>
		<pubDate>Fri, 20 Mar 2009 05:12:42 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=164</guid>
		<description><![CDATA[server { server_name domain.com; rewrite ^(.*)$ http://www.domain.com$1 permanent; }]]></description>
			<content:encoded><![CDATA[<pre>server {
    server_name domain.com;
    rewrite ^(.*)$ http://www.domain.com$1 permanent;
}</pre>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=164" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/03/20/permanent-redirect-with-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx and worker_connections are more than open file resource limit warning</title>
		<link>http://charles.lescampeurs.org/2009/03/09/nginx-and-worker_connections-are-more-than-open-file-resource-limit-warning?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nginx-and-worker_connections-are-more-than-open-file-resource-limit-warning</link>
		<comments>http://charles.lescampeurs.org/2009/03/09/nginx-and-worker_connections-are-more-than-open-file-resource-limit-warning#comments</comments>
		<pubDate>Mon, 09 Mar 2009 20:30:26 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Distro]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[ulimit]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=160</guid>
		<description><![CDATA[If you encounter this warning message under Linux: 2009/03/09 21:23:19 [warn] 26827#0: 4096 worker_connections are more than open file resource limit: 1024 A solution is to use the command ulimit in nginx start script, just before lunching nginx: [...] ulimit  -n 65536 [...]]]></description>
			<content:encoded><![CDATA[<p>If you encounter this warning message under Linux:</p>
<pre>2009/03/09 21:23:19 [warn] 26827#0: 4096 worker_connections are more than open file resource limit: 1024</pre>
<p>A solution is to use the command ulimit in nginx start script, just before lunching nginx:</p>
<pre>[...]
ulimit  -n 65536
[...]</pre>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=160" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/03/09/nginx-and-worker_connections-are-more-than-open-file-resource-limit-warning/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Amazon is moving into CDN market</title>
		<link>http://charles.lescampeurs.org/2008/11/25/amazon-is-moving-into-cdn-market?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=amazon-is-moving-into-cdn-market</link>
		<comments>http://charles.lescampeurs.org/2008/11/25/amazon-is-moving-into-cdn-market#comments</comments>
		<pubDate>Tue, 25 Nov 2008 21:46:53 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[CDN]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=127</guid>
		<description><![CDATA[As read in Diamond Notes, Amazon is moving into CDN market with CloudFront. Some Content Delivery Network providers Akamaï Akamaï on Crunchbase BitGravity BitGravity on Crunchbase EdgeCast Networks EdgeCast Networks on Crunchbase Limelight Network Limelight Network on Crunchbase Panther Express Panther Express on Crunchbase]]></description>
			<content:encoded><![CDATA[<p>As read in <a href="http://www.paragon-cs.com/wordpress/2008/11/19/a-cloudfront-is-moving-in/" target="_blank">Diamond Notes</a>, Amazon is moving into <a href="http://en.wikipedia.org/wiki/Content_Delivery_Network" target="_blank">CDN</a> market with <a href="http://aws.amazon.com/cloudfront/" target="_blank">CloudFront</a>.</p>
<h2>Some Content Delivery Network providers</h2>
<ul>
<li><a href="http://www.akamai.com" target="_blank">Akamaï</a>
<ul>
<li><a href="http://www.crunchbase.com/company/akamai">Akamaï on Crunchbase</a></li>
</ul>
</li>
<li><a href="http://www.bitgravity.com/" target="_blank">BitGravity</a>
<ul>
<li><a href="http://www.crunchbase.com/company/bitgravity" target="_blank">BitGravity on Crunchbase</a></li>
</ul>
</li>
<li><a href="http://www.edgecast.com/" target="_blank">EdgeCast Networks</a>
<ul>
<li><a href="http://www.crunchbase.com/company/edgecast" target="_blank">EdgeCast Networks on Crunchbase</a></li>
</ul>
</li>
<li><a href="http://www.limelightnetworks.com/" target="_blank">Limelight Network<br />
</a></p>
<ul>
<li><a href="http://www.crunchbase.com/company/limelightnetworks" target="_blank">Limelight Network on Crunchbase</a></li>
</ul>
</li>
<li><a href="http://pantherexpress.net/" target="_blank">Panther Express</a>
<ul>
<li><a href="http://www.crunchbase.com/company/panther-express" target="_blank">Panther Express on Crunchbase</a></li>
</ul>
</li>
</ul>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=127" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/11/25/amazon-is-moving-into-cdn-market/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix nginx increase server_names_hash_bucket_size error</title>
		<link>http://charles.lescampeurs.org/2008/11/14/fix-nginx-increase-server_names_hash_bucket_size?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fix-nginx-increase-server_names_hash_bucket_size</link>
		<comments>http://charles.lescampeurs.org/2008/11/14/fix-nginx-increase-server_names_hash_bucket_size#comments</comments>
		<pubDate>Fri, 14 Nov 2008 09:28:10 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=112</guid>
		<description><![CDATA[When adding new virtual hosts in your nginx configuration file, you can experience this error message: # nginx -t 2008/11/13 09:37:03 [emerg] 12299#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32 2008/11/13 09:37:03 [emerg] 12299#0: the configuration file /etc/nginx/nginx.conf test failed server_names_hash_bucket_size controls the maximum length of a virtual host entry (ie the [...]]]></description>
			<content:encoded><![CDATA[<p>When adding new virtual hosts in your nginx configuration file, you can experience this error message:</p>
<pre># nginx -t
2008/11/13 09:37:03 [emerg] 12299#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2008/11/13 09:37:03 [emerg] 12299#0: the configuration file /etc/nginx/nginx.conf test failed</pre>
<p><em><a href="http://wiki.codemongers.com/NginxHttpCoreModule#server_names_hash_bucket_size" target="_blank">server_names_hash_bucket_size</a></em> controls the maximum length of a virtual host entry (ie the length of the domain name).</p>
<p>In other words, if your domain names are long, increase this parameter.</p>
<p>You need to add this flag in the <em>http</em> context:</p>
<pre>http {
    server_names_hash_bucket_size 64;
    ...
}</pre>
<p>After increasing the value, test your configuration file and reload nginx:</p>
<pre># nginx -t
2008/11/13 09:48:06 [info] 12315#0: the configuration file /etc/nginx/nginx.conf syntax is ok
2008/11/13 09:48:06 [info] 12315#0: the configuration file /etc/nginx/nginx.conf was tested successfully
# kill -HUP `cat /var/run/nginx.pid`</pre>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=112" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/11/14/fix-nginx-increase-server_names_hash_bucket_size/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Maintenance mode (HTTP 503) with lighttpd and PHP</title>
		<link>http://charles.lescampeurs.org/2008/07/22/maintenance-mode-http-503-with-lighttpd-and-php?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=maintenance-mode-http-503-with-lighttpd-and-php</link>
		<comments>http://charles.lescampeurs.org/2008/07/22/maintenance-mode-http-503-with-lighttpd-and-php#comments</comments>
		<pubDate>Tue, 22 Jul 2008 00:28:08 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=28</guid>
		<description><![CDATA[When you put your website in maintenance mode, it&#8217;s a good idea to return a HTTP 503 error code to the client. This code indicates that &#8220;the server is currently unable to handle the request due to a temporary overloading or maintenance of the server&#8221;. The 503 code is used to avoid crawlers or caching [...]]]></description>
			<content:encoded><![CDATA[<p>When you put your website in maintenance mode, it&#8217;s a good idea to return a HTTP 503 error code to the client.</p>
<p>This code indicates that <em>&#8220;the server is currently unable to handle the request due to a    temporary overloading or maintenance of the server&#8221;</em>.</p>
<p>The 503 code is used to avoid crawlers or caching proxy use the maintenance page as the new valid content for the request. You certainly don&#8217;t want Google save this content in his search index as the content of your website <img src='http://charles.lescampeurs.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To achieve this we will use a rewrite rule in lighttpd to redirect all requests to a single PHP script which will return a 503 error code and print an informative message.</p>
<h2>Lighttpd configuration</h2>
<pre>url.rewrite = ( "" =&gt; "/maintenance.php" )</pre>
<p>This configuration will redirect any request to maintenance.php script.</p>
<p>If you need to serve an image in your maintenance page, you have to add another rule to the rewrite process like that :</p>
<pre>url.rewrite = ( "upgrading.png" =&gt; "$0",
                "" =&gt; "/maintenance.php" )</pre>
<h3>Let some users see the website</h3>
<p>It might be usefull to let admins or developers access the website during the maintenance.<br />
For that, you can disable the maintenance rewrite rule for certain IP addresses :</p>
<pre> $HTTP["remoteip"] != “192.168.1.42″ {
               url.rewrite = ( "upgrading.png" =&gt; "$0",
                      "" =&gt; "/maintenance.php" )
}</pre>
<h2>PHP code example</h2>
<pre>&lt;?php
header("HTTP/1.1 503 Service Unavailable");
?&gt;
We're currently upgrading our servers...</pre>
<h2>Links</h2>
<ul>
<li><a title="HTTP/1.1 error codes" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" target="_blank">RFC 2616 HTTP/1.1</a></li>
<li><a title="HTTP status codes" href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes">HTTP status codes on Wikipedia</a></li>
</ul>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=28" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/07/22/maintenance-mode-http-503-with-lighttpd-and-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Permanent redirect (301) with lighttpd</title>
		<link>http://charles.lescampeurs.org/2008/06/30/permanent-redirect-301-with-lighttpd?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=permanent-redirect-301-with-lighttpd</link>
		<comments>http://charles.lescampeurs.org/2008/06/30/permanent-redirect-301-with-lighttpd#comments</comments>
		<pubDate>Mon, 30 Jun 2008 21:47:37 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[lighttpd]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=25</guid>
		<description><![CDATA[If you want to redirect visitors that access your website without the &#8216;www&#8217;, you can use mod_redirect with the following syntax: $HTTP[”host”] =~ “^lescampeurs\.org” { url.redirect = ( ”^/(.*)$” =&#62; “http://www.lescampeurs.org/$1″ ) } Links: Lighttpd mod_redirect HTTP 3xx status codes]]></description>
			<content:encoded><![CDATA[<p>If you want to redirect visitors that access your website without the &#8216;www&#8217;, you can use <em>mod_redirect</em> with the following syntax:</p>
<pre>$HTTP[”host”] =~ “^lescampeurs\.org” {
    url.redirect = (
        ”^/(.*)$” =&gt; “http://www.lescampeurs.org/$1″
    )
}
</pre>
<p>Links:</p>
<ul>
<li><a title="mod_redirect with lighttpd" href="http://trac.lighttpd.net/trac/wiki/Docs:ModRedirect" target="_blank">Lighttpd mod_redirect</a></li>
<li><a title="HTTP 3xx status codes" href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection" target="_blank">HTTP 3xx status codes</a></li>
</ul>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=25" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/06/30/permanent-redirect-301-with-lighttpd/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rotate Apache logs with Cronolog</title>
		<link>http://charles.lescampeurs.org/2008/06/04/rotate-apache-logs-with-cronolog?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rotate-apache-logs-with-cronolog</link>
		<comments>http://charles.lescampeurs.org/2008/06/04/rotate-apache-logs-with-cronolog#comments</comments>
		<pubDate>Wed, 04 Jun 2008 05:33:20 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cronolog]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=20</guid>
		<description><![CDATA[Cronolog is log rotation program which gives you a lot of options to template the log destination files. The common use is to split logs by year / month / day. Here is how to configure Apache to send log entries to cronolog : CustomLog "&#124;/usr/sbin/cronolog /home/log/apache2/%Y-%m-%d_domain.com_access.log" combined This will create a log file named [...]]]></description>
			<content:encoded><![CDATA[<p><a title="cronolog log rotation" href="http://cronolog.org/" target="_blank">Cronolog</a> is log rotation program which gives you a lot of options to template the log destination files. The common use is to split logs by year / month / day.</p>
<p>Here is how to configure Apache to send log entries to cronolog :</p>
<pre>CustomLog "|/usr/sbin/cronolog /home/log/apache2/%Y-%m-%d_domain.com_access.log" combined</pre>
<p>This will create a log file named <em>2008-06-02_domain.com_access.log</em> for today.</p>
<p>Cronolog reads log entries from standard input and writes them to the output file specified by your template.</p>
<h2>More examples</h2>
<ul>
<li>Rotate by month :</li>
</ul>
<pre>CustomLog "|/usr/sbin/cronolog /home/log/apache2/%Y-%m_domain.com_access.log" combined</pre>
<ul>
<li>Rotate by week number :</li>
</ul>
<pre>CustomLog "|/usr/sbin/cronolog /home/log/apache2/%Y-%W_domain.com_access.log" combined</pre>
<ul>
<li>Rotate hourly</li>
</ul>
<pre>CustomLog "|/usr/sbin/cronolog /home/log/apache2/%H_domain.com_access.log" combined</pre>
<h2>Links</h2>
<ul>
<li><a title="cronolog usage" href="http://cronolog.org/usage.html" target="_blank">All cronolog templating flags</a></li>
<li><a title="Apache 2 mod_log_config" href="http://httpd.apache.org/docs/2.0/mod/mod_log_config.html" target="_blank">Apache 2 mod_log_config documentation</a></li>
</ul>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=20" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/06/04/rotate-apache-logs-with-cronolog/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deny access to .svn directories with Apache2 / lighttpd</title>
		<link>http://charles.lescampeurs.org/2008/05/28/deny-access-to-svn-directories-with-apache2-lighttpd?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=deny-access-to-svn-directories-with-apache2-lighttpd</link>
		<comments>http://charles.lescampeurs.org/2008/05/28/deny-access-to-svn-directories-with-apache2-lighttpd#comments</comments>
		<pubDate>Wed, 28 May 2008 05:17:31 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=19</guid>
		<description><![CDATA[If you&#8217;re using SVN to control your web application, your certainly need to deny access to .svn sub-directories. With Apache2 &#60;DirectoryMatch "^/.*/\.svn/"&#62; Order allow,deny Deny from all &#60;/DirectoryMatch&#62; With lighttpd $HTTP["url"] =~ "/\.svn/" { url.access-deny = ( "" ) }]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using SVN to control your web application, your certainly need to deny access to <em>.svn</em> sub-directories.</p>
<h2>With Apache2</h2>
<pre>    &lt;DirectoryMatch "^/.*/\.svn/"&gt;
            Order allow,deny
            Deny from all
    &lt;/DirectoryMatch&gt;</pre>
<h2>With lighttpd</h2>
<pre>    $HTTP["url"] =~ "/\.svn/" {
        url.access-deny = ( "" )
    }</pre>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=19" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/05/28/deny-access-to-svn-directories-with-apache2-lighttpd/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress replaces pound by nginx</title>
		<link>http://charles.lescampeurs.org/2008/05/08/wordpress-replaces-pound-by-nginx?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-replaces-pound-by-nginx</link>
		<comments>http://charles.lescampeurs.org/2008/05/08/wordpress-replaces-pound-by-nginx#comments</comments>
		<pubDate>Thu, 08 May 2008 05:12:20 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[load balancer]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=13</guid>
		<description><![CDATA[After two years of using Pound, WordPress decided to switch to Nginx as software load balancers for WordPress.com. Read the full story on Barry&#8217;s Blog.]]></description>
			<content:encoded><![CDATA[<p>After two years of using <a title="The Pound program is a reverse proxy, load balancer" href="http://www.apsis.ch/pound/" target="_blank">Pound</a>, WordPress decided to switch to <a href="http://nginx.net/" target="_blank">Nginx</a> as software load balancers for WordPress.com. Read the full story on <a title="Barry on WordPress" href="http://barry.wordpress.com/2008/04/28/load-balancer-update/" target="_blank">Barry&#8217;s Blog</a>.</p>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=13" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/05/08/wordpress-replaces-pound-by-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use mod_redirect with lighttpd</title>
		<link>http://charles.lescampeurs.org/2008/05/06/use-mod_redirect-with-lighttpd?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-mod_redirect-with-lighttpd</link>
		<comments>http://charles.lescampeurs.org/2008/05/06/use-mod_redirect-with-lighttpd#comments</comments>
		<pubDate>Tue, 06 May 2008 10:56:08 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[lighttpd]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=5</guid>
		<description><![CDATA[Enable mod_redirect server.modules += ( "mod_redirect" ) Force your domain with www. $HTTP["host"] =~ "^domain\.com$" { url.redirect = ( "^/(.*)" =&#62; "http://www.domain.com/$1" ) } Force your domain without www. $HTTP["host"] =~ "^www\.domain\.com$" { url.redirect = ( "^/(.*)" =&#62; "http://domain.com/$1" ) } Redirect HTTP requests to HTTPS $SERVER["socket"] == ":80" { $HTTP["host"] =~ "(.*)" { url.redirect [...]]]></description>
			<content:encoded><![CDATA[<h2>Enable mod_redirect</h2>
<pre>server.modules += ( "mod_redirect" )</pre>
<h2>Force your domain with www.</h2>
<pre>$HTTP["host"] =~ "^domain\.com$" {
    url.redirect = ( "^/(.*)" =&gt; "http://www.domain.com/$1" )
}</pre>
<h2>Force your domain without www.</h2>
<pre>$HTTP["host"] =~ "^www\.domain\.com$" {
    url.redirect = ( "^/(.*)" =&gt; "http://domain.com/$1" )
}</pre>
<h2>Redirect HTTP requests to HTTPS</h2>
<pre>$SERVER["socket"] == ":80" {
    $HTTP["host"] =~ "(.*)" {
        url.redirect = ( "^/(.*)" =&gt; "https://%1/$1" )
    }
}</pre>
<h2>Redirect an old domain to your new domain</h2>
<pre>$HTTP["host"] =~ "^www1\.domain\.com" {
    url.redirect = ( "^/(.*)" =&gt; "http://www.domain.com/$1" )
}</pre>
<h2>Redirect a url that can be matched by a mod_rewrite rule</h2>
<p>Lets say that you want to redirect http://www.domain.com/party to http://blog.domain.com/party while you have a mod_rewrite rule on www.domain.com that redirect all URLs to a controller (&#8220;^(.*)$&#8221; =&gt; &#8220;/index.php$1&#8243;).</p>
<p>Your redirect will not work because <em>mod_rewrite</em> always execute before redirect rules. To bypass this, you need to use the $0 as the rule target to pass URLs through unmangled.</p>
<p>e.g.</p>
<pre>url.redirect = ( "^/party(.*)" =&gt; "http://blog.domain.com/party$1" )
url.rewrite-once = ( "^/party" =&gt; "$0" )</pre>
<p><em>tested with lighttpd 1.4.x</em></p>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/05/06/use-mod_redirect-with-lighttpd/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

