RewriteRule提取字符的问题

RewriteRule提取字符的问题

站点搬迁原有的URL需要301到新的URL上
old url:
www.mysite.com/blog/read.php/238.htm
new url
www.mysite.com/blog/?p=238
我写了一段:
RewriteCond %{PATH_INFO} [0-9]+
RewriteRule ^read\.php/[0-9]+\.htm$ /blog/?p=%{PATH_INFO} [R=301,L]
但是问题出在那个%{PATH_INFO} 上,如何让RewriteRule那行的 %{PATH_INFO}也就是/238.htm只提取238这几个数字呢?
不知道我的问题说明白没有T_T
那个变量必须都用

[Copy to clipboard] [ - ]
CODE:
HTTP headers: connection & request:  
HTTP_USER_AGENT
HTTP_REFERER
HTTP_COOKIE
HTTP_FORWARDED
HTTP_HOST
HTTP_PROXY_CONNECTION
HTTP_ACCEPT
REMOTE_ADDR
REMOTE_HOST
REMOTE_PORT
REMOTE_USER
REMOTE_IDENT
REQUEST_METHOD
SCRIPT_FILENAME
PATH_INFO
QUERY_STRING
AUTH_TYPE
  
server internals: date and time: specials:
DOCUMENT_ROOT
SERVER_ADMIN
SERVER_NAME
SERVER_ADDR
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE
TIME_YEAR
TIME_MON
TIME_DAY
TIME_HOUR
TIME_MIN
TIME_SEC
TIME_WDAY
TIME
API_VERSION
THE_REQUEST
REQUEST_URI
REQUEST_FILENAME
IS_SUBREQ
HTTPS

这里的吗?
自己已经解决
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{query_string} [0-9]+
RewriteRule ^read\.php$ /blog/?p=%{query_string} [R=301,L]
RewriteRule ^read\.php/([0-9]+)\.htm$ /blog/?p=$1 [R=301,L]
</IfModule>
用到了RewriteRule反向引用
解决过程在
http://www.2doit.net/blog/?p=542