[sclug] Apache rewrite

Sapan Ganguly sapan.ganguly at gmail.com
Sun Oct 26 17:07:22 UTC 2008


Ah, this worked!

Rewritecond %{REQUEST_URI} /index.php$
RewriteCond %{QUERY_STRING} ^id=18&L=de&C=DE$
RewriteRule ^.*$ http://www.site2.com/index.php?id=18&L=de&C=DE [R,L]

Thanks for the pointer Keith.

Sapan


2008/10/26 Sapan Ganguly <sapan.ganguly at gmail.com>

>
> Hmmm, I tried that as well, but it still isn't working, maybe I'm doing
> something wrong?
>
> RewriteCond %{QUERY_STRING} ^id=18&L=de&C=DE$
> RewriteRule ^$ http://www.site2.com/index.php?id=18&L=de&C=DE [R,L]
>
> Thanks for the reply by the way.
>
> Sapan
>
> 2008/10/26 Keith Edmunds <kae at midnighthax.com>
>
> On Sun, 26 Oct 2008 15:50:32 +0000, sapan.ganguly at gmail.com said:
>>
>> > But in the rewrite log all I see it trying to match is "index.php"
>>
>> You can't match on the query string like that. From
>> http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritebase
>>
>> "The Pattern will not be matched against the query string. Instead, you
>> must use a RewriteCond with the %{QUERY_STRING} variable."
>>
>> hth,
>> Keith
>>
>>
>> --
>> Keith Edmunds
>>
>>
>> +-------------------------------------------------------------------------+
>> |    Tiger Computing Ltd    |  Helping businesses make the most of Linux
>>  |
>> |  "The Linux Specialists"  |       http://www.tiger-computing.co.uk
>>  |
>>
>> +-------------------------------------------------------------------------+
>>
>
>



More information about the Sclug mailing list