httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Gingras <francois.ging...@gmail.com>
Subject Re: [users@httpd] mod_rewrite?
Date Mon, 19 Sep 2011 13:32:54 GMT
On 19/09/2011 8:59 AM, J-H Johansen wrote:
> On Mon, Sep 19, 2011 at 2:51 PM, topinambour ####<otpinambour@gmail.com>wrote:
>
>> Hi
>>
>> I have some problems about
>> to write rewriterule in .htaccess
>> I use spip and URL_propre
>>
>> URL read by google as :
>> #URL_site/#URL_ARTICLE?page=fr
>> i would want to use to remove:?lang=fr and do :
>> /#URL_SITE/#URL_ARTICLE
>>
>> Summary, it would be :
>> http://monsite.org/-Description-?lang=fr
>> to redirect to
>> http://monsite.org/-Description-
>>
>> I write :
>> RewriteRule  ^\?lang=fr$    ^[^\.]$ [L,R=302]
>> nothing do
>>
>> any ideas please
>>
> Something like this maybe?
>
> RewriteRule  ^(.*)\?lang=fr$ $1 [L,R=302]
>
>

You can't match the query string with RewriteRule. Instead, use a RewriteCond with %{QUERY_STRING}

Frank.

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message