You did turn the \d you had into /d, that's a problem. But mostly your expression only allows for /p/568/ with nothing after it.
Couple other comments, mostly about readability (always a good thing to aim for when dealing with regular expressions):
- You don't need to escape slashes: that's only needed for escaping them as regex delimiters but mod_rewrite doesn't use any
- {1} is redundant
- \d and [\d] mean the same thing
- The replacement URL isn't a regex
- 9/10 times you'll want the [L] flag too
Code: Select all
RewriteRule ^/?([a-z])/(\d+)/ test.php?t=$1&p_id=$2 [L,NC]
I use ^/? because depending on various circumstances the URL being matched against may or may not start with a slash.