Msg#: 4585687 posted 11:33 am on Jun 19, 2013 (gmt 0)
I am trying to to rewrite /mail/config-v1.1.xml to autoconfig.php and saving possible parameters like "?firstname.lastname@example.org", so that "http://email@example.com" leads to "firstname.lastname@example.org"
But the parameters should be optional; that is what I am trying in the first rule.
RewriteEngine on RewriteRule ^/mail/config-v1\.1\.xml(\?)?(.*)$ /autoconfig.php [L] RewriteRule ^/mail/config-v1\.1\.xml\?emailaddress=(.*)$ /autoconfig.php?($1) [L]
Msg#: 4585687 posted 12:01 pm on Jun 19, 2013 (gmt 0)
welcome to WebmasterWorld, debianer!
you cannot examine the query string in the RewriteRule Pattern - you have to use a RewriteCond directive for that. however in your case, you aren't testing or capturing anything in the query string, you are reusing all of it - intact. by default, the query string is passed through unchanged.
also, depending on the context in which your RewriteRule is implemented, the path information of the request can be modified by the server's mod_rewrite processing. if your RewriteRule is in the .htaccess file of the document root diretory, then the leading slash will be stripped from the requested url.
assuming this, you probably are good with something like this:
RewriteEngine on RewriteRule ^mail/config-v1\.1\.xml$ /autoconfig.php [L]