<?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>sysadmin Tips &#187; Apache2</title>
	<atom:link href="http://www.djinns.net/tag/apache2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.djinns.net</link>
	<description></description>
	<lastBuildDate>Sat, 09 Jan 2010 15:12:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rewrite rules for maintenance</title>
		<link>http://www.djinns.net/2009/12/21/rewrite-rules-for-maintenance/</link>
		<comments>http://www.djinns.net/2009/12/21/rewrite-rules-for-maintenance/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 16:50:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Apache2]]></category>
		<category><![CDATA[Rewrite]]></category>

		<guid isPermaLink="false">http://www.djinns.net/sysadmin/?p=4</guid>
		<description><![CDATA[Here is the minimal (and the ultimate) rewrite rules to put a website in maintenance mode, works for Apache 2.x:
Options FollowSymLinks

AllowOverride All

RewriteEngine On

RewriteEngine on

RewriteCond %{REQUEST_URI} !\.gif$ [NC]

RewriteCond %{REQUEST_URI} !/maintenance.html$

RewriteRule $ /maintenance.html [R=307,L]
If you have anothers ressources in the maintenance.html page, like a css or js files, add more RewriteCond conditions:
RewriteCond %{REQUEST_URI} !\.css$ [NC]

RewriteCond %{REQUEST_URI} !\.js$ [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Here is the minimal (and the ultimate) rewrite rules to put a website in maintenance mode, works for Apache 2.x:</p>
<pre class="brush: php">Options FollowSymLinks

AllowOverride All

RewriteEngine On

RewriteEngine on

RewriteCond %{REQUEST_URI} !\.gif$ [NC]

RewriteCond %{REQUEST_URI} !/maintenance.html$

RewriteRule $ /maintenance.html [R=307,L]</pre>
<p style="text-align: justify;">If you have anothers ressources in the maintenance.html page, like a css or js files, add more RewriteCond conditions:</p>
<pre class="brush: php">RewriteCond %{REQUEST_URI} !\.css$ [NC]

RewriteCond %{REQUEST_URI} !\.js$ [NC]

RewriteCond %{REQUEST_URI} !\.png$ [NC]</pre>
<p style="text-align: justify;">Also, you can add a RewriteCond conditions to bypass the maintenance mode from a specific IP (or subnet &#8230;):</p>
<pre class="brush: php">RewirteCond %{REMOTE_ADDR} !xxx\.xxx\.xxx\.xxx</pre>
<p style="text-align: justify;">Don&#8217;t forget to activate the rewrite module in Apache2, on a Debian:</p>
<pre class="brush: php"># a2enmod rewrite

# apache2ctl configtest

# /etc/init.d/apache2 reload</pre>
<p style="text-align: justify;">Externals resources:</p>
<ul style="text-align: justify;">
<li><a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">Apache 2.2 mod_rewrite</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.djinns.net/2009/12/21/rewrite-rules-for-maintenance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
