php - Trouble with URL rewriting in .htaccess -
php - Trouble with URL rewriting in .htaccess -
my .htaccess
file looks this:
rewriteengine on rewriterule ^articles/(\d+)*$ ./articles.php?id=$1
so, if url foo.com/articles/123
requested, command transferred articles.php?id=123
.
however, if requested url is:
foo.com/articles/123/
or
foo.com/articles/123/whatever
i "404 not found" response.
i phone call articles.php?id=123
in these cases. so, if url starts foo.com/articles/[digits]...
no matter other characters follow digits, execute articles.php?id=[digits]
. (the rest of url discarded.)
how have alter regular look in order accomplish this?
just don't end:
rewriterule ^articles/(\d+) ./articles.php?id=$1
php url mod-rewrite
Comments
Post a Comment