This is the code I use,
<IfModule mod_rewrite.c>
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([^/]+)/?([^/]+) index.php?user=$1&do=$2 [L]
</IfModule>
if i give it abcd/1234
it will capture abcd
first then 1234
as the second variable. But if the url was abcd/
or abcd
the first capture stays the same, yet the second capture becomes d
. This would cause no problem in the php code itself, yet it would be more efficient if it was not captured in the first place.
oh to clarify, neither the first or second capture are required for the index.php page. But will change its purpose if they exist.
any help with the regex code would be appreciated, and if there are anyways to improve it more or write it more efficiently i would be very grateful to know!
Thank You very Much : )
i use this tool http://gskinner.com/RegExr/ to check this.