I've been using an .htacccess file to define a rewrite rule for extracting the username from the end of a url for years.
The username has always been a combination of letters and numbers following a forward / and that is all, and it has been working just fine. Here it is... When finished, $_GET['m'] would yield that username
php_value session.gc_maxlifetime 14400
RewriteEngine On
RewriteRule ^([a-z0-9]+)$ /index.php?m=$1 [NC,L] # captures member username no case last rule
ErrorDocument 404 http://domainname.com/load_error.php
Now I have an affiliate code from an outside source, so I can't control what the characters are in it.
I need to be able to capture the affiliate code at the end of a url that now begins with a ? and multiple characters after it.
examples ( ?afmc=1i / ?afmc=24 / ?afmc=2m / ?afmc=1b)
What I need is to capture the affiliate code including the ? to use for a DB query.
I don't know if the affiliate code will always maintain that exact structure as the number of affiliates increases beyond the possible number of combinations of 10 digits and 26 letters.
Any help would be appreciated to capture the ? and whatever comes after it.
thanks.
Douglas