Tags: lighttpd

Fix CodeIgniter IP address detection on lighttpd

If the results of a call to $this->input->ip_address() gives you “0.0.0.0” (the “invalid address” response) and you’re running lighttpd as your web server, you may be able to fix it with a minor tweak to by extending one of the base CodeIgniter libraries. An IPv6-style header is being appended to the IPv4 address, most likely, and stripping it out before CodeIgniter considers the validity of your address should restore functionality without circumventing any of the logic. Read More →

URL rewriting template engine

My employer is currently in the process of standing-up a content management system (CMS). In the process of migrating links on our existing site to the new CMS site, there are going to be—at least, at first—a metric tonne of possible URL redirects necessary. Since the majority of these will fall into a handful of categories, I began creating IIRF (Ionic ISAPI Rewrite Filter) URL rewriting rules that would, for instance, move a particular list of “Offices” from /offices/officename to http://newserver/offices/officename. (Note: These directives should be compatible with Apache’s mod_rewrite, and even lighttpd’s url.rewrite, as well.) Read More →