You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by topinambour #### <ot...@gmail.com> on 2011/09/19 14:51:41 UTC

[users@httpd] mod_rewrite?

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

[users@httpd] Re: mod_rewrite?

Posted by topinambour #### <ot...@gmail.com>.
URL :
http://monsite.org/-Description-?lang=fr
follows to be 200 and accepted
I paste my .htaccess with paste expiration 1 day
rewrite00 <http://pastebin.com/fT14WcDq>

In wait


2011/9/19 topinambour #### <ot...@gmail.com>

> 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
>

Re: [users@httpd] mod_rewrite?

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Sep 22, 2011 at 9:23 PM, topinambour #### <ot...@gmail.com> wrote:
> good evening
> it seems that i do not have rewrite.log in /usr/local/var .
> An missing configuration after compiling httpd2.2.20? perhaps
> And in /var nothing too.
>

Which is why I said 'turn on the rewrite log' instead of 'go look at
the rewrite log'.

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog

Cheers

Tom

---------------------------------------------------------------------
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


Re: [users@httpd] mod_rewrite?

Posted by topinambour #### <ot...@gmail.com>.
good evening
it seems that i do not have rewrite.log in /usr/local/var .
An missing configuration after compiling httpd2.2.20? perhaps
And in /var nothing too.

So I think i have some  "road"
It's to say:
It must remove ALL strings after an ? in final URL

writting:
RewriteEngine On
RewriteBase      /
RewriteCond     %{QUERY_STRING}  .
RewriteRule  ^[^\.]+(\.html)       /^[^\.]+(\.html)?$ [L]

but problem is : What to do with attractive URL spip code:
URL_PROPRE
putting blank or ^ first or ( or [
and $ at final or not.

I 'm going to try
regards


Hum i hope.

2011/9/22 Tom Evans <te...@googlemail.com>

> On Thu, Sep 22, 2011 at 9:34 AM, topinambour #### <ot...@gmail.com>
> wrote:
> > Someone has an idea abot what to do
> > thanks in advance
> >
> >
>
> Turn on the rewrite log, make some requests which you think should be
> rewritten, look at the rewrite log and work out why it wasn't.
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> 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
>
>

Re: [users@httpd] mod_rewrite?

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Sep 22, 2011 at 9:34 AM, topinambour #### <ot...@gmail.com> wrote:
> Someone has an idea abot what to do
> thanks in advance
>
>

Turn on the rewrite log, make some requests which you think should be
rewritten, look at the rewrite log and work out why it wasn't.

Cheers

Tom

---------------------------------------------------------------------
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


Re: [users@httpd] mod_rewrite?

Posted by topinambour #### <ot...@gmail.com>.
Someone has an idea abot what to do
thanks in advance


2011/9/21 topinambour #### <ot...@gmail.com>

> Sorry
> An mistake
> url redirect gives a broken link!
>
>
> 2011/9/20 topinambour #### <ot...@gmail.com>
>
>> good morning
>>
>> Yes i tried it without \?
>> no match :-(
>>
>> but with standard output with :
>> RewriteRule ^(.*)$
>> and no putting ^lang=fr$ in RewriteRule in old URL
>> because it's automatic with RewriteCond %{QUERY_STRING}
>>
>> ------>>
>> Output browser in other place in home network reject URL -->302
>> merci!
>> thanks a lot :-)
>>
>> 2011/9/19 topinambour #### <ot...@gmail.com>
>>
>>> Other try:
>>> RewriteCond %{QUERY_STRING} ^\?lang=fr$
>>> RewriteRule ^[^\.]$/%1         ^[^\.]$             [L,R=302]
>>>
>>> then it continue with in inside network
>>> 200 answer:-( in server
>>> and it continue with ?lang=fr in url browser zone
>>> without http://monsite.org/-Description-<http://monsite.org/-Description-?lang=fr>automatic redirect
>>>
>>> So one thing
>>> there's no500 error
>>>
>>>
>>>
>>> 2011/9/19 Frank Gingras <fr...@gmail.com>
>>>
>>>> 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<http://monsite.org/-Description-?lang=fr>
>>>>>> to redirect to
>>>>>> http://monsite.org/-**Description- <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<http://httpd.apache.org/userslist.html>>
>>>> for more info.
>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.org<us...@httpd.apache.org>
>>>>  "   from the digest: users-digest-unsubscribe@**httpd.apache.org<us...@httpd.apache.org>
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>
>>>>
>>>
>>
>

Re: [users@httpd] mod_rewrite?

Posted by topinambour #### <ot...@gmail.com>.
Sorry
An mistake
url redirect gives a broken link!

2011/9/20 topinambour #### <ot...@gmail.com>

> good morning
>
> Yes i tried it without \?
> no match :-(
>
> but with standard output with :
> RewriteRule ^(.*)$
> and no putting ^lang=fr$ in RewriteRule in old URL
> because it's automatic with RewriteCond %{QUERY_STRING}
>
> ------>>
> Output browser in other place in home network reject URL -->302
> merci!
> thanks a lot :-)
>
> 2011/9/19 topinambour #### <ot...@gmail.com>
>
>> Other try:
>> RewriteCond %{QUERY_STRING} ^\?lang=fr$
>> RewriteRule ^[^\.]$/%1         ^[^\.]$             [L,R=302]
>>
>> then it continue with in inside network
>> 200 answer:-( in server
>> and it continue with ?lang=fr in url browser zone
>> without http://monsite.org/-Description-<http://monsite.org/-Description-?lang=fr>automatic redirect
>>
>> So one thing
>> there's no500 error
>>
>>
>>
>> 2011/9/19 Frank Gingras <fr...@gmail.com>
>>
>>> 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<http://monsite.org/-Description-?lang=fr>
>>>>> to redirect to
>>>>> http://monsite.org/-**Description- <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<http://httpd.apache.org/userslist.html>>
>>> for more info.
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.org<us...@httpd.apache.org>
>>>  "   from the digest: users-digest-unsubscribe@**httpd.apache.org<us...@httpd.apache.org>
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>
>

Re: [users@httpd] mod_rewrite?

Posted by topinambour #### <ot...@gmail.com>.
good morning

Yes i tried it without \?
no match :-(

but with standard output with :
RewriteRule ^(.*)$
and no putting ^lang=fr$ in RewriteRule in old URL
because it's automatic with RewriteCond %{QUERY_STRING}

------>>
Output browser in other place in home network reject URL -->302
merci!
thanks a lot :-)

2011/9/19 topinambour #### <ot...@gmail.com>

> Other try:
> RewriteCond %{QUERY_STRING} ^\?lang=fr$
> RewriteRule ^[^\.]$/%1         ^[^\.]$             [L,R=302]
>
> then it continue with in inside network
> 200 answer:-( in server
> and it continue with ?lang=fr in url browser zone
> without http://monsite.org/-Description-<http://monsite.org/-Description-?lang=fr>automatic redirect
>
> So one thing
> there's no500 error
>
>
>
> 2011/9/19 Frank Gingras <fr...@gmail.com>
>
>> On 19/09/2011 8:59 AM, J-H Johansen wrote:
>>
>>> On Mon, Sep 19, 2011 at 2:51 PM, topinambour ####<ot...@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<http://monsite.org/-Description-?lang=fr>
>>>> to redirect to
>>>> http://monsite.org/-**Description- <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<http://httpd.apache.org/userslist.html>>
>> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.org<us...@httpd.apache.org>
>>  "   from the digest: users-digest-unsubscribe@**httpd.apache.org<us...@httpd.apache.org>
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>

Re: [users@httpd] mod_rewrite?

Posted by Frank Gingras <fr...@gmail.com>.

On 09/19/2011 10:33 AM, topinambour #### wrote:
> Other try:
> RewriteCond %{QUERY_STRING} ^\?lang=fr$
> RewriteRule ^[^\.]$/%1         ^[^\.]$             [L,R=302]
>
> then it continue with in inside network
> 200 answer:-( in server
> and it continue with ?lang=fr in url browser zone
> without http://monsite.org/-Description-
> <http://monsite.org/-Description-?lang=fr> automatic redirect
>
> So one thing
> there's no500 error
>
>
> 2011/9/19 Frank Gingras <francois.gingras@gmail.com
> <ma...@gmail.com>>
>
>     On 19/09/2011 8:59 AM, J-H Johansen wrote:
>
>         On Mon, Sep 19, 2011 at 2:51 PM, topinambour
>         ####<otpinambour@gmail.com <ma...@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
>             <http://monsite.org/-Description-?lang=fr>
>             to redirect to
>             http://monsite.org/-__Description-
>             <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
>     <http://httpd.apache.org/userslist.html>> for more info.
>     To unsubscribe, e-mail: users-unsubscribe@httpd.__apache.org
>     <ma...@httpd.apache.org>
>     "   from the digest: users-digest-unsubscribe@__httpd.apache.org
>     <ma...@httpd.apache.org>
>     For additional commands, e-mail: users-help@httpd.apache.org
>     <ma...@httpd.apache.org>
>
>

Remove \?. You can't match the question mark, in any context.

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


Re: [users@httpd] mod_rewrite?

Posted by topinambour #### <ot...@gmail.com>.
Other try:
RewriteCond %{QUERY_STRING} ^\?lang=fr$
RewriteRule ^[^\.]$/%1         ^[^\.]$             [L,R=302]

then it continue with in inside network
200 answer:-( in server
and it continue with ?lang=fr in url browser zone
without http://monsite.org/-Description-<http://monsite.org/-Description-?lang=fr>automatic
redirect

So one thing
there's no500 error


2011/9/19 Frank Gingras <fr...@gmail.com>

> On 19/09/2011 8:59 AM, J-H Johansen wrote:
>
>> On Mon, Sep 19, 2011 at 2:51 PM, topinambour ####<ot...@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<http://monsite.org/-Description-?lang=fr>
>>> to redirect to
>>> http://monsite.org/-**Description- <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<http://httpd.apache.org/userslist.html>>
> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.org<us...@httpd.apache.org>
>  "   from the digest: users-digest-unsubscribe@**httpd.apache.org<us...@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] mod_rewrite?

Posted by Frank Gingras <fr...@gmail.com>.
On 19/09/2011 8:59 AM, J-H Johansen wrote:
> On Mon, Sep 19, 2011 at 2:51 PM, topinambour ####<ot...@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


Re: [users@httpd] mod_rewrite?

Posted by J-H Johansen <on...@gmail.com>.
On Mon, Sep 19, 2011 at 2:51 PM, topinambour #### <ot...@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]


-- 
Jens-Harald Johansen
--
There are 10 kinds of people in the world: Those who understand binary and
those who don't...