Category: Web Dev


Komodo Edit Theme

Anybody want my spiffy dark komodo edit color scheme?  Based off of this excellent theme: http://www.dottedidesign.com/node/16

Download Charcoal Rainbow Mod here:
https://www.sugarsync.com/pf/D910673_8064236_268889

IE absolute URLs

It seems that there is a bit of a strange issue with Internet Explorers 6 and 7 where if you have an absolute href in an anchor tag.  That will be rewritten to include the protocol and domain name.  This won’t effect the way the link works, but if we are doing some fancy javascript handling of our links, then we have a problem.

Simple Site Maintenance Page via .htaccess

I wanted to post this as I often forget those code snippets I use only a few times each year.  This simple addition to the .htaccess file will allow you to display a page to people coming to your site while letting you still see the site normally.

RewriteEngine On
RewriteCond %{REQUEST_URI} !/maintenance.html
RewriteCond %{REMOTE_HOST} !^10\.10\.10\.10
RewriteRule $ /maintenance.html [R=302,L]

Simply replace the 10s with your IP and if desired change the name of the file you want to display (2X).  If you already have “RewriteEngine On” in your .htaccess file be sure to remove that part as it will be redundant.

The first line simply ensures that you don’t redirect forever.  The second ensures that you won’t redirect yourself, or others at your public IP address.  The last will send everyone else to your maintenance message, in this case at /maintenance.html.

Also, if you want users to still be able to access your site’s asset files you can add something like:

RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)

to the beginning of the rewrite rule which will ignore the redirect to maintenance.html for image, css and javascript files.

Powered by WordPress | Theme: Motion by 85ideas.