apache

temporarily redirecting all traffic except images to static page

Here's an .htaccess file that does the trick nicely, even providing a 302 temporary redirect:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png)$
RewriteRule !^site_maintenance\.html$ /site_maintenance.html [L,R=302]
</IfModule>

Subdomains on localhost

Say you are into developing locally, but want to have distinct domains for each project you've got.

IE -

foo.localhost
bar.localhost
jo-mama.localhost

Here's the easiest way I found for doing this in Ubuntu 9.10:

sudo nano /etc/hosts

Here you'll want to add in unique identifiers for each of the subdomains, such as:

127.0.0.1 localhost
127.0.0.2 foo.localhost
127.0.0.3 bar.localhost
127.0.0.4 jo-mama.localhost

sudo nano /etc/apache2/sites-available/subdomains

Syndicate content