Leopard and mod_rewrite

February 10th, 2008 by tbaumgard

It seems that there are dozens of websites out there with solutions to getting mod_rewrite to work in Leopard. The solution for me was the second set of instructions on Michael Krol’s blog. His instructions were intended for Tiger, but worked for me nonetheless.

Basically the user config file (/etc/apache2/users/USERNAME.conf) needs to be edited to look similar to this:

<Directory "/Users/USERNAME/Sites/">
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

I underlined the parts that are necessary for this to work. Then just restart apache by using the command he provided, or by turning off web sharing and turning it back on right away.

I didn’t need to edit the /etc/apache2/httpd.conf file, although it appears that some people had to, whether out of necessity or because they did both sets of instructions and everything worked, thinking both were necessary. Running 10.5.x, which was freshly installed. Not sure if everything would work on a Mac that was upgraded from Tiger to Leopard.

Table Printing Issues in Firefox

December 12th, 2007 by tbaumgard

Apparently there is an issue when printing tables that span more than one page in Firefox, and any other Gecko-based browser for that matter. I found one solution which linked to an A List Apart article. They attributed the issue to floated elements that run “past the bottom of a printed page.” I tried their solution, but it didn’t work for the table that was causing the problem. I then found the a second solution which seemed to fix the problem. So in the end, I added the following code to the print stylesheet:

/** Fix for tables longer than one printed page in Gecko-based browsers **/
table,td  {
    height: 100%;
}

Seeing as the second solution worked and I had other things to do, I didn’t try to figure out why the first hadn’t.

Hiding a Class if JavaScript is Disabled

December 8th, 2007 by tbaumgard

Basically needed to be able to display a message if JavaScript was disabled, or just not available. Just give the classname “_JscptHide” to whatever needs to be hidden if JavaScript is enabled. Here’s the code:

JscptHide.js:

// Append style to created div (works in IE, Firefox)
var _JscptHide = document.createElement("div");
_JscptHide.innerHTML = "<style type='text/css'>._JscptHide{display:none;}</style>";
document.body.appendChild(_JscptHide);

// Append style element to the head (works in Safari, Firefox)
_JscptHide = document.createElement("style");
var _JscptHide_Style = document.createTextNode("._JscptHide{display:none;}");
_JscptHide.type = "text/css";
_JscptHide.appendChild(_JscptHide_Style);
document.getElementsByTagName("head")[0].appendChild(_JscptHide);

The two blocks of code were needed for cross-browser support.
The following site was inspiration for the first portion, I thought up the second part:

Geek Daily Blog

Yay…

December 8th, 2007 by admin

It’s up.