添加另一个正则表达式变体:
RewriteRule ^media/news/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /media/news/article.php?article_url_year=$1&article_url_month=$2&article_url_title=$3&article_id=$4 [L]
例如对于 URL PATH:/media/news/2012/11/test-article/1
重写日志(如果启用)将显示:
[rid#7f920b4b00a0/initial] (3) [perdir /srv/www/htdocs/] applying pattern '^media/news/([^/]+)/([^/]+)/([^/]+)/([^/]+)$' to uri 'media/news/2012/11/test-article/1'
[rid#7f920b4b00a0/initial] (2) [perdir /srv/www/htdocs/] rewrite 'media/news/2012/11/test-article/1' -> '/media/news/article.php?article_url_year=2012&article_url_month=11&article_url_title=test-article&article_id=1'
[rid#7f920b4b00a0/initial] (3) split uri=/media/news/article.php?article_url_year=2012&article_url_month=11&article_url_title=test-article&article_id=1 -> uri=/media/news/article.php, args=article_url_year=2012&article_url_month=11&article_url_title=test-article&article_id=1
[rid#7f920b4b00a0/initial] (2) [perdir /srv/www/htdocs/] trying to replace prefix /srv/www/htdocs/ with /
[rid#7f920b4b00a0/initial] (1) [perdir /srv/www/htdocs/] internal redirect with /media/news/article.php [INTERNAL REDIRECT]
[rid#7f920bcdda00/initial/redir#1] (3) [perdir /srv/www/htdocs/] strip per-dir prefix: /srv/www/htdocs/media/news/article.php -> media/news/article.php
[rid#7f920bcdda00/initial/redir#1] (3) [perdir /srv/www/htdocs/] applying pattern '^media/news/([^/]+)/([^/]+)/([^/]+)/([^/]+)$' to uri 'media/news/article.php'
[rid#7f920bcdda00/initial/redir#1] (1) [perdir /srv/www/htdocs/] pass through /srv/www/htdocs/media/news/article.php