Jump to main navigation

Category: Web

Removing index.html with mod_rewrite in .htaccess

It's quite easy to remove index.html from a URL with mod_rewrite. Let's say we want to redirect www.dense13.com/index.html to www.dense13.com:

RewriteEngine On
RewriteRule ^index\.html$ / [R=301,L]

Here's a brief explanation, if you're not familiar with .htaccess syntax: Read the full text...

Thunderbird drag-and-drop problem in Ubuntu

For a while I couldn't drag emails to other folders in Thunderbird, which was very frustrating and made organizing my email very slow. I had to right-click on the message and use the 'Move to' option. Which is especially annoying if you organize your email in a nested folder structure.

It turns out the problem was AllTray, an Ubuntu application that lets you minimize any application to the system tray. So until I find a compatible solution, good-bye to Thunderbird in the system tray.

Converting a string to slug with JavaScript

Recently I've been working on implementing slugs in my CMS to be able to generate nicer URLs. In order to do so I've created a little JavaScript function that converts a string to a slug. I'll first give you the code and then explain it a bit. [update: 2.07.10 Fixed IE issue][update: 18.09.10 Minor improvements] Read the full text...

How to access AWStats from outside cPanel

Sometimes it's interesting to be able to access awstats from outside cPanel, for example if you're hosting a client's website and you want them to be able to check awstats, but without giving them access to cPanel. You'd think that this would be an option provided by cPanel itself, but as far as I know it's not.

I've been doing some research and although various pages offer methods to achieve this, none of them fully worked for me (which tends to be the case when you don't really know what you're doing). Finally I've managed to get it working by mixing bits and pieces from different sources, so I've decided to post my solution here, in case it helps anyone else. Read the full text...

mod_rewrite changes url to lower-case in Windows

Using mod_rewrite to ensure canonical URL's in my CMS, I run across a strange behavior (bug?) of mod_rewrite. It seems that in Windows and under certain circumstances, it changes the case of the URL to lowercase. While this normally won't be a problem (Windows URL's are case insensitive) it can have undesirable effects if you need process the URL with PHP, for example. Read the full text...

Internet Explorer and innerHTML in PRE elements

While I was working on modifying SHJS (a JavaScript syntax highlighter), I came across a very frustrating (and initially extremely puzzling) IE bug. Well, it might not be a bug, but it's a very strange and illogical behaviour. In short: IE performs text normalization when setting innerHTML. Sebastian Redl explains it in The Internet Explorer innerHTML Quirk. Read the full text...

Pure CSS rounded corners for good browsers

After exploring the possibility to add multiple background images to an element, I realized it was possible to use that technique to create boxes with rounded corners in a very clean, CSS-only way. In particular:

  • No need to add any extra markup.
  • No need to know the dimensions of the element. In fact the element can be resized freely, which makes it perfect for fluid layouts.
  • Pure CSS solution.

The catch is: this technique relies on the use of generated content, so it doesn't work in IE6 or IE7. Which makes it pretty much useless for real projects, unless for some reason you can ignore IE. Read the full text...

Multiple background images with CSS2

Here's an interesting way to add multiple background images to an element using CSS2. Before anyone gets too excited, since this technique uses generated content it doesn't work with IE6 nor IE7. Maybe IE8 will support generated content, but who knows.

Still it's fun to try, and if you can ignore IE, then this might be useful sometimes. It works in Firefox 2/3 and Opera 9 under Windows XP, at least.

In this article I'll first guide you through a basic example, and then we'll create a nicer box. Read the full text...

Styling table captions with CSS: fixing the width problem

Styling table captions with CSS is not always an easy task. The specific issue I'll be dealing with in this article is the fact that the width of the caption doesn't naturally fit the width of the table. First I'll introduce the problem and then present a cross browser solution. Read the full text...

New (modified) JavaScript syntax highlighter: SHJS

I was having a few problems with the syntax highlighter I was using for the code blocks in this blog, so I decided to look for an alternative. There are a few out there, but my choice went to SHJS. I liked it straight away, although I wanted a couple of features that are not there. So I got my hands dirty and wrote some code to implement them. Here's a description of what I've done, in case someone has similar needs. Read the full text...

Additional content and navigation


Main navigation menu