If you are a CodeIgniter enthusiast, you know that finding rewrite rules for Apache (htaccess file) is relatively easy, but doing the same for Nginx rewrite rules is not all that simple. Use these Nginx rewrite rules to get your next CodeIgniter project up and running.
This is a quick tip if you’re looking for a “required_if” rule in CodeIgniter. Basically the rule is as follows: Make form field-A required if form field-B is filled in. The most common case scenario is changing a password, where the original password is required first, but is conditional only if a new password is entered.
This is the .htaccess file that I use for my CodeIgniter PHP projects (some of these .htaccess rules can be used for any project, keep reading). CodeIgniter uses mod_rewrite to route all requests to the CI front controller. I’ve made some additions in an attempt to canocalize some of the CodeIgniter URL end points. The key benefit of a canocalized URL is that your search engine page ranking (page juice) is not spread across several pages, but instead, targeted to a single page.