My .htaccess
file looks like this:
RewriteEngine On
RewriteRule ^articles/(\d+)*$ ./articles.php?id=$1
So, if the URL foo.com/articles/123
is requested, control is transferred to articles.php?id=123
.
However, if the requested URL is:
foo.com/articles/123/
or
foo.com/articles/123/whatever
I get a "404 Not Found" response.
I would like to call articles.php?id=123
in all these cases. So, if the URL starts with foo.com/articles/[digits]...
no matter what other characters follow the digits, I would like to execute articles.php?id=[digits]
. (The rest of the URL is discarded.)
How do I have to change the regular expression in order to achieve this?