<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>.Htaccess on Evan Hoffman</title><link>https://evan.wtf/tags/.htaccess/</link><description>Recent content in .Htaccess on Evan Hoffman</description><generator>Hugo</generator><language>en-US</language><copyright>Evan Hoffman</copyright><lastBuildDate>Fri, 08 Oct 2010 18:11:42 +0000</lastBuildDate><atom:link href="https://evan.wtf/tags/.htaccess/index.xml" rel="self" type="application/rss+xml"/><item><title>Putting up a "down for maintenance" message using mod_rewrite</title><link>https://evan.wtf/2010/10/08/putting-up-a-down-for-maintenance-message-using-mod_rewrite-2/</link><pubDate>Fri, 08 Oct 2010 18:11:42 +0000</pubDate><guid>https://evan.wtf/2010/10/08/putting-up-a-down-for-maintenance-message-using-mod_rewrite-2/</guid><description>&lt;p&gt;Putting this here for safekeeping so my future self can find it. Mod_rewrite is one of my favorite tools, but it&amp;rsquo;s easy to spend 30 minutes crafting a 2-line directive that actually does what you want. I put this in a .htaccess file in the DocumentRoot of the server, put a &amp;ldquo;We&amp;rsquo;re down&amp;rdquo; message in maintenance.html (or whatever), and all requests will get a 302 redirect to /maintenance.html, except requests for /maintenance.html (for obvious reasons). It appends the original request in case you want to do something with it but that&amp;rsquo;s not really important. It also doesn&amp;rsquo;t do the redirect for images/js/css so those can actually be used in the maintenance message.&lt;/p&gt;</description></item><item><title>Putting up a "down for maintenance" message using mod_rewrite</title><link>https://evan.wtf/2010/10/08/putting-up-a-down-for-maintenance-message-using-mod_rewrite/</link><pubDate>Fri, 08 Oct 2010 18:11:42 +0000</pubDate><guid>https://evan.wtf/2010/10/08/putting-up-a-down-for-maintenance-message-using-mod_rewrite/</guid><description>&lt;p&gt;Putting this here for safekeeping so my future self can find it. Mod_rewrite is one of my favorite tools, but it&amp;rsquo;s easy to spend 30 minutes crafting a 2-line directive that actually does what you want. I put this in a .htaccess file in the DocumentRoot of the server, put a &amp;ldquo;We&amp;rsquo;re down&amp;rdquo; message in maintenance.html (or whatever), and all requests will get a 302 redirect to /maintenance.html, except requests for /maintenance.html (for obvious reasons). It appends the original request in case you want to do something with it but that&amp;rsquo;s not really important. It also doesn&amp;rsquo;t do the redirect for images/js/css so those can actually be used in the maintenance message.&lt;/p&gt;</description></item></channel></rss>