In the past, all of my Articles were under a section called "Articles", and my mod_rewrite looked like this...
Code:
#PRETTY: articles/postage-meters-can-save-you-money
#UGLY: articles/article.php?slug=postage-meters-can-save-you-money
#Rewrite only if the request is not pointing to a real file (e.g. add_comment.php, index.php).
RewriteCond %{REQUEST_FILENAME} !-f
#Match any kind of slug. PHP will decide if it's valid or not.
RewriteRule articles/(.+)$ articles/article.php?slug=$1 [L]
Since then I have changed things so that my "articles/index.php" script dynamically prepends a "Section" to the URL like this...
local.debbie/finance/articles/postage-meters-can-save-you-money
In the URL above, how can I capture both the Section (i.e. "Finance") and the Article Slug (i.e. "postage-meters-can-save-you-money") in my mod_rewrite?
I tried this, but it was causing some "Internal Server Error"...
Code:
#RewriteRule (.+)/articles/(.+)$ $1/articles/article.php?slug=$2 [L]
Debbie