How to tell Apache to ignore a certain part of an SEO friendly URL, but include the rest

I'm using SEO friendly URLs throughout a client site. The RewriteRule function is being used to do this, as follows:

RewriteRule ^index/(.*)/ index.php?p=$1
RewriteRule ^index/(.*)/(.*)/ index.php?p=$1&q=$2

I want to write some URLs for a forum topic page, as follows:

/index/thread/this-is-the-topic-title-1/

Basically the only thing I want being passed to the PHP query is the number (this is the Thread ID), the text "this-is-the-topic-title-" needs to be ignored, but I don't know how to do that.

Any ideas?

Thanks in advance.
DReade83Asked:
Who is Participating?
 
diaFConnect With a Mentor Commented:
try

RewriteRule ^index/(.*)/.*-([0-9]*)/ index.php?p=$1&q=$2
0
 
DReade83Author Commented:
Thank you very much - that worked a treat. :-)
0
All Courses

From novice to tech pro — start learning today.