<?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 Valley &#187; php</title>
	<atom:link href="http://www.sysadminvalley.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sysadminvalley.com</link>
	<description>I might as well write this stuff down so I remember it tomorrow</description>
	<lastBuildDate>Wed, 25 Jan 2012 15:06:43 +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>Setting up a Maintenance page with Apache and Cookies</title>
		<link>http://www.sysadminvalley.com/2009/05/16/setting-up-a-maintenance-page-with-apache-and-cookies/</link>
		<comments>http://www.sysadminvalley.com/2009/05/16/setting-up-a-maintenance-page-with-apache-and-cookies/#comments</comments>
		<pubDate>Sat, 16 May 2009 11:39:04 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=85</guid>
		<description><![CDATA[There are times when you want to make changes to your website and you do not want your visitors to see the site before you have finished deploying and testing the website.  Here is an example using Apache, mod_rewrite and a cookie set by a PHP page. First, create your maintenance webpage called maintenance.html.  Second, [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you want to make changes to your website and you do not want your visitors to see the site before you have finished deploying and testing the website.  Here is an example using Apache, mod_rewrite and a cookie set by a PHP page.</p>
<p>First, create your maintenance webpage called maintenance.html.  Second, create a file called set_cookie.php with the following contents</p>
<blockquote><p>&lt;?php<br />
setcookie(&#8220;testing&#8221;, &#8220;testing&#8221;, time()+36000);  /* expire in 600 minutes */<br />
?&gt;</p></blockquote>
<p>Next, create a file called .htaccess in your main web directory with the following contents</p>
<blockquote><p>RewriteEngine on<br />
RewriteCond %{HTTP_COOKIE} !testing<br />
RewriteCond %{REQUEST_URI} !/maintenance.html$<br />
RewriteCond %{REQUEST_URI} !/set_cookie.php$<br />
RewriteCond %{REQUEST_URI} !/logo\.jpg$<br />
RewriteRule ^(.*) /maintenance.html [NC,L]</p></blockquote>
<p>Lastly, in your web browser, go to http://www.yourdomain.com/set_cookie.php.  From that point on, you will be able to browse your website, but your visitors will be redirected to your maintenance.html webpage</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2009/05/16/setting-up-a-maintenance-page-with-apache-and-cookies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

