Thank you.it works perfectly.

-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: beginners@perl.org; [EMAIL PROTECTED]
Sent: Fri, 10 Aug 2007 6.16PM
Subject: Re: Help me with an url rewrite

 Hello,

well this is more of a mod_rewrite question.

The problem is that you have to use the QUERY_STRING variable in order to access parameters, these are not part of the normal scope of the RewriteCond / RewriteRule stuff. Refer to the mod_rewrite guide for that.

We use this to append a user ID to the request:

RewriteCond %{QUERY_STRING} .
RewriteCond %{QUERY_STRING} !^userid=
RewriteRule ^/.* /our_server/?userid=user32&%{QUERY_STRING} [R,L]

So in your case you should try (untested)

RewriteEngine on
RewriteRule ^/(.+)$ http://www.site.com/%{QUERY_STRING}&domain=abc

Hope this helps.

Nils

[EMAIL PROTECTED] schrieb:
> I'm not sure if I've asked the correct lists,but hope I can get some
helps here.:)
>
> I need a mod_rewrite rule,rewrite this url:
> http://abc.site.com/index.php?q1=v1
> to:
> http://www.site.com/index.php?q1=v1&domain=abc
>
> I applicated this rule:
>
> RewriteEngine on
> RewriteRule ^/(.+)$ http://www.site.com/$1&domain=abc
>
>
> But I'm faint I can't get the correct result,it rewrote the url to:
>
> http://www.site.com/index.php&domain=abc?q1=v1
>
> (not http://www.site.com/index.php?q1=v1&domain=abc)
>
> This disorder the things,I do hate it.
>
> Can you show me a correct way?thanks.
> ________________________________________________________________________ > Check out the new free AOL Email -- 2GB of storage and > industry-leading spam and email virus protection.
>



________________________________________________________________________
Check out the new free AOL Email -- 2GB of storage and industry-leading spam and email virus protection.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to