The Pattern will not be matched against the query string.
Instead, you must use a RewriteCond
with the
%{QUERY_STRING}
variable. You can, however, create
URLs in the substitution string, containing a query string
part. Simply use a question mark inside the substitution string, to
indicate that the following text should be re-injected into the
query string. When you want to erase an existing query string,
end the substitution string with just a question mark. To
combine a new query string with an old one, use the
[QSA]
flag.
You can do this. Know though that the RewriteRule only works on theOn Mon, Jul 14, 2008 at 23:07, Randy Grimes <randygrimes15@xxxxxxxxx> wrote:
> Hi, I know mod_rewrite can answer web request to /xyz and internally serving
> a.php?xyz . However, is it possible to answer a.php?xyz and internally
> serving /xyz , without writing a script a.php? For the curious minds, we
> are moving from dynamic scripts to pre-generated static pages, and want to
> maintain old links to outside.
URL, and ignores the query string. You can use the query string in
RewriteCond lines though.
So you could use something like this:
RewriteCond %{QUERY_STRING} ^(.+)$
RewriteRule /a.php %1
Basically what this rule does is chekc if the url matches a.php and if
it does then it checks if the QUERY_STRING is at least on charachter
long, capturing it in the process. If that is the case the URL is
replaced with the captured query.
Krist
--
krist.vanbesien@xxxxxxxxx
krist@xxxxxxxxxxxxx
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
" from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx