Chovy’s Blog

Mod Rewrite Rules You Can Live With

Wed, August 23, 2006 — Category: Development

I had some issues upgrading to the latest apache 2.0, which turned out to have apparently broken my mod rewrite rules.
As usual, my problem turned out to be a trivial fix. In httpd.conf I hadn’t merged the AllowOverride None line directly…to use mod rewrite rules in your .htaccess file correctly, this value has to be […]

I had some issues upgrading to the latest apache 2.0, which turned out to have apparently broken my mod rewrite rules.

As usual, my problem turned out to be a trivial fix. In httpd.conf I hadn’t merged the AllowOverride None line directly…to use mod rewrite rules in your .htaccess file correctly, this value has to be set to “All” instead of “None”.

AllowOverride All will allow you to use mod rewrite rules in your .htaccess file.

Here’s a simple test:

Open foo.html and bar.html, and add those respective words to the file. (foo.html contains “foo”, bar.html contains “bar”).

Now, open up your .htaccess file (typically, /path/to/yoursite.com/htdocs/.htaccess), and add the following mod rewrite rules:

RewriteEngine on
RewriteRule  foo.html    bar.html  [L]

Now access: yoursite.com/foo.html

You should see the word “bar” instead of “foo” in your browser.

For debugging, try enabling mod rewrite’s log level to 9.

See the mod rewrite documentation for more info and examples of mod rewrite rules.

  • Post Mod Rewrite Rules You Can Live With to del.icio.us
  • Post Mod Rewrite Rules You Can Live With to digg
  • Post Mod Rewrite Rules You Can Live With to Furl
  • Add Mod Rewrite Rules You Can Live With to YahooMyWeb
  • Simpify!
  • Post Mod Rewrite Rules You Can Live With to shadows
  • Post Mod Rewrite Rules You Can Live With to Spurl
  • Post Mod Rewrite Rules You Can Live With to BuddyMarks
  • Submit Mod Rewrite Rules You Can Live With to Slashdot

Programming Cheat Sheet

Sat, August 5, 2006 — Category: Development

Came across another programming cheat sheet (with examples) via digg.
The article is Programming is Hard: Let’s work to make it a little easier. and provides lots of snippets and examples from different programming languages.

Came across another programming cheat sheet (with examples) via digg.
The article is Programming is Hard: Let’s work to make it a little easier. and provides lots of snippets and examples from different programming languages.

  • Post Programming Cheat Sheet to del.icio.us
  • Post Programming Cheat Sheet to digg
  • Post Programming Cheat Sheet to Furl
  • Add Programming Cheat Sheet to YahooMyWeb
  • Simpify!
  • Post Programming Cheat Sheet to shadows
  • Post Programming Cheat Sheet to Spurl
  • Post Programming Cheat Sheet to BuddyMarks
  • Submit Programming Cheat Sheet to Slashdot

PHP Database Programming Mistakes

Sat, August 5, 2006 — Category: Development

There’s a good article from IBM about the five common PHP database problems users encounter when working with databases and php.
Some of the tips include refraining from directly access mysql php functions (this should be abstracted to a database layer, so you can swap out your database easily without having to modify the code).
Also it […]

There’s a good article from IBM about the five common PHP database problems users encounter when working with databases and php.

Some of the tips include refraining from directly access mysql php functions (this should be abstracted to a database layer, so you can swap out your database easily without having to modify the code).

Also it talks about the n+1 pattern, in which the app retrieves a list of items, then cycles through each item and grabs the relevant info for each item. In a small database, this is not a problem, but with over 1,000 records, that’s 1,000 more database queries to retrieve the info.

A lot of this recurring can be solved with database relations and normalization.

It also recommends not using more than 1 database for an entire application.

  • Post PHP Database Programming Mistakes to del.icio.us
  • Post PHP Database Programming Mistakes to digg
  • Post PHP Database Programming Mistakes to Furl
  • Add PHP Database Programming Mistakes to YahooMyWeb
  • Simpify!
  • Post PHP Database Programming Mistakes to shadows
  • Post PHP Database Programming Mistakes to Spurl
  • Post PHP Database Programming Mistakes to BuddyMarks
  • Submit PHP Database Programming Mistakes to Slashdot
Next Page »
 
Keyword Advertisers:
SEO Directory SEO Links Free Link Directory Shopping Submission Directory Gardening Tips Political Forum Search Engine Optimization Search Engine Marketing Audio Video Directory SEO Forum Web Development Blog Organic SEO Wiki Web Development Consulting

Learn more about purchasing keyword text link ads on this site.