by richardk » Sun Feb 01, 2009 3:59 pm
Your regular expression only matches /something/something.
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
# Don't match existing files.
RewriteCond %{SCRIPT_FILENAME} !-f
# Don't match existing directories.
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)/?$ /index.php?page=$1 [QSA,L]
RewriteRule ^([^/]+)/([^/]+)/?$ /index.php?page=$1&id=$2 [QSA,L]
Or in one rule
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)(?:/([^/]+))?/?$ /index.php?page=$1&id=$2 [QSA,L]