This should work for you.
RewriteBase /
# Stop rewrite process if the path points to a static file anyway
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteRule (.*) index.php
Explained in words: If the requested resource is a folder or a file don't rewrite, if not rewrite to the index.php.
In your case wa.admin/index.php?login_msg=nopassword will look like wa.admin/?login_msg=nopassword.
Don't forget to update you application. This rule only mapps requests to the appropriate files. This doesn't impact you HTML output. This means with this rewriting you can access both URLs but it's up to you which you want to link in your application.
If you want to distribute your app with others you may use the environment in combination with the if tag to determine whether mod_rewrite is available or not.
<IfModule mod_rewrite.c>
# Enable URL rewriting
RewriteEngine On
# Set flag so we know URL rewriting is available
SetEnv REWRITEURLS 1
# You will have to change the path in the following option if you
# experience problems while your installation is located in a subdirectory
# of the website root.
RewriteBase /
# Stop rewrite process if the path points to a static file anyway
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteRule (.*) index.php
</IfModule>
Use apache_getenv("REWRITEURLS"); to acess the value of the set variable.
You code might look like this (untested):
<?php
$rewriteurls = apache_getenv("REWRITEURLS");
if ($rewriteurls == '1') {
//adjust all your links
}
?>