Step 1: Turn the engine on and set the base (especially where you have virtual hosts)
Code:
RewriteEngine on
RewriteBase /
Step 2: Make sure that the request isn't for a file or directory:
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
The !-f means not a file and !-d means not a directory
Step 3. Change foo/bar into index.php?section=foo&page=bar
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+)/(.+) index.php?section=$1&page=$2 [L]
. = any character
.+ = 1 or more of any character
(.+) = group answer for later reference as $1
(.+)/(.+) = captures front and back strings into $1 and $2