Skip to main content.

2007-Aug-23

A website was redirecting whenever it didn't have a trailing slash on a folder name. This was on apache 1.3.x. I fixed it by reversing the ServerAlias and ServerName directives within the virtualhost container. The previous ServerName was actually on different server by DNS (and was in place for testing).

If piping into a while loop in /bin/sh, setting variables is an undefined behaviour, so may not be available after loop. One work around is to put a { ... } or ( .... ) after the pipe and around the while do ... done loop (that sets the variable inside) and then use the variable before the } or ) closes.