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:


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.
Who is Participating?
diaFConnect With a Mentor Commented:

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

From novice to tech pro — start learning today.