Forum Moderators: phranque
Thanks
John
That should be quite easy. Does the original URL request actually use a {QUERY_STRING} here? Your example URL does not contain a query string. You'll need to create and use a backreference something like this:
RewriteRule ^abc/([^/]+)/$ /abc.php?def=$1&%{QUERY_STRING} [L]
If your (working) localhost is Apache 2.2 and the (non-working) server is and older version, then that would explain it: Older versions of Apache use the POSIX regular expressions usually bundled with the OS, while Apache 2.2 supports PCRE (PERL-Compatible Regular Expressions). So you'll have trouble using PCRE tokens like "\w" on older versions of Apache.
If g1smd's pattern above is not selective enough for your needs, then this should work on any version of Apache:
RewriteRule ^abc/([0-9a-z_\-]+)/$ /abc.php?def=$1 [NC,L]
Jim