Search code examples
apachemod-rewriteapache2apache-config

Apache Mod Rewrite Conf to ignore part of URL


Let's say I have the domain http://www.example.com.

When I browse to http://www.example.com/12345 it brings me the person having id 12345 from database. I want it to work even I write some other meaningless bunch of characters at the end of the URL; http://www.example.com/12345/qwerty.

This is the current config:

RewriteRule ^/(\d+)$ /person.php?id=$1 [QSA,L]

What should I add to this config?


Solution

  • RewriteRule ^/(\d+) /person.php?id=$1 [QSA,L]

    ignores everthing after the numbers..