Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

URL-Rewrite Problem

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


anuchettan10 at yahoo

Oct 16, 2009, 5:41 AM

Post #1 of 5 (387 views)
Permalink
URL-Rewrite Problem

I have a problem with rewriting certain urls which contains special characters.Please have a look at the following urls
RewriteRule ^/Football/Quarter-Reports%C2%A0    /Football/Quarter-Reports  [R=301,L]
The problem is the server interprets it differently as the special characters change the url.
If I changer the rule to something like RewriteRule ^/Football/Trend-Reports(.*) or [a-zA-Z0-9-]*
it will not redirect properly.
Some another examples are given below.
1) RewriteRule ^/Tennis/Play/xyx-xyz-s-Winning-game%20target=   /Tennis/Play/xyx-xyz-s-Winning-game   /Tennis/Play/xyx-xyz-s-Winning-game [R=301,L]
2)  RewriteRule ^/Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/ST%C3%86RK       /Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/STAERK

Does anybody has any experience with this? Please suggest some solutions.


icicimov at gmail

Oct 16, 2009, 6:00 AM

Post #2 of 5 (374 views)
Permalink
Re: URL-Rewrite Problem [In reply to]

Have you tried the NE flag in the rewrite rule?

On Fri, Oct 16, 2009 at 10:41 PM, Anoop.V <anuchettan10 [at] yahoo> wrote:

> I have a problem with rewriting certain urls which contains special
> characters.Please have a look at the following urls
> RewriteRule ^/Football/Quarter-Reports%C2%A0 /Football/Quarter-Reports
> [R=301,L]
> The problem is the server interprets it differently as the special
> characters change the url.
> If I changer the rule to something like RewriteRule
> ^/Football/Trend-Reports(.*) or [a-zA-Z0-9-]*
> it will not redirect properly.
> Some another examples are given below.
> 1) RewriteRule ^/Tennis/Play/xyx-xyz-s-Winning-game%20target=
> /Tennis/Play/xyx-xyz-s-Winning-game /Tennis/Play/xyx-xyz-s-Winning-game
> [R=301,L]
> 2) RewriteRule
> ^/Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/ST%C3%86RK
> /Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/STAERK
>
> Does anybody has any experience with this? Please suggest some solutions.
>
>
>
>


anuchettan10 at yahoo

Oct 16, 2009, 6:06 AM

Post #3 of 5 (379 views)
Permalink
Re: URL-Rewrite Problem [In reply to]

Thanks for the reply,
Yes.I tried.That too is not working.I find it a strange problem.



--- On Fri, 10/16/09, Igor Cicimov <icicimov [at] gmail> wrote:

From: Igor Cicimov <icicimov [at] gmail>
Subject: Re: [users [at] http] URL-Rewrite Problem
To: users [at] httpd
Date: Friday, October 16, 2009, 6:30 PM

Have you tried the NE flag in the rewrite rule?

On Fri, Oct 16, 2009 at 10:41 PM, Anoop.V <anuchettan10 [at] yahoo> wrote:


I have a problem with rewriting certain urls which contains special characters.Please have a look at the following urls
RewriteRule ^/Football/Quarter-Reports%C2%A0    /Football/Quarter-Reports  [R=301,L]
The problem is the server interprets it differently as the special characters change the url.

If I changer the rule to something like RewriteRule ^/Football/Trend-Reports(.*) or [a-zA-Z0-9-]*
it will not redirect properly.
Some another examples are given below.
1) RewriteRule ^/Tennis/Play/xyx-xyz-s-Winning-game%20target=   /Tennis/Play/xyx-xyz-s-Winning-game   /Tennis/Play/xyx-xyz-s-Winning-game [R=301,L]

2)  RewriteRule ^/Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/ST%C3%86RK       /Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/STAERK

Does
anybody has any experience with this? Please suggest some solutions.


j.zuckerman at gmail

Oct 16, 2009, 10:48 AM

Post #4 of 5 (361 views)
Permalink
Re: URL-Rewrite Problem [In reply to]

On Fri, Oct 16, 2009 at 6:06 AM, Anoop.V <anuchettan10 [at] yahoo> wrote:

> Thanks for the reply,
> Yes.I tried.That too is not working.I find it a strange problem.
>
>
>
> --- On *Fri, 10/16/09, Igor Cicimov <icicimov [at] gmail>* wrote:
>
>
> From: Igor Cicimov <icicimov [at] gmail>
> Subject: Re: [users [at] http] URL-Rewrite Problem
> To: users [at] httpd
> Date: Friday, October 16, 2009, 6:30 PM
>
>
> Have you tried the NE flag in the rewrite rule?
>
> On Fri, Oct 16, 2009 at 10:41 PM, Anoop.V <anuchettan10 [at] yahoo<http://mc/compose?to=anuchettan10 [at] yahoo>
> > wrote:
>
>> I have a problem with rewriting certain urls which contains special
>> characters.Please have a look at the following urls
>> RewriteRule ^/Football/Quarter-Reports%C2%A0 /Football/Quarter-Reports
>> [R=301,L]
>> The problem is the server interprets it differently as the special
>> characters change the url.
>> If I changer the rule to something like RewriteRule
>> ^/Football/Trend-Reports(.*) or [a-zA-Z0-9-]*
>> it will not redirect properly.
>> Some another examples are given below.
>> 1) RewriteRule ^/Tennis/Play/xyx-xyz-s-Winning-game%20target=
>> /Tennis/Play/xyx-xyz-s-Winning-game /Tennis/Play/xyx-xyz-s-Winning-game
>> [R=301,L]
>> 2) RewriteRule
>> ^/Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/ST%C3%86RK
>> /Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/STAERK
>>
>> Does anybody has any experience with this? Please suggest some solutions.
>>
>>
>>
>>
>
>
This is becoming my standard response but I have to ask, why?

There may be a really great explanation but those rewrite/redirect rules
you're suggesting seem bizarre (converting raw-url-encoded to non-encoded?)
and very very specific, how many of them do you plan to write? one for every
URL on your page? Would it not be simpler to modify the application to more
robustly handle the querystring/url parameters?


icicimov at gmail

Oct 17, 2009, 12:50 AM

Post #5 of 5 (363 views)
Permalink
Re: URL-Rewrite Problem [In reply to]

I agree with Jonathan but in mean time you can try this

RewriteRule ^/Football/Quarter-Reports\%C2\%A0 /Football/Quarter-Reports
[NE,R=301,L]




On Sat, Oct 17, 2009 at 3:48 AM, Jonathan Zuckerman
<j.zuckerman [at] gmail>wrote:

> On Fri, Oct 16, 2009 at 6:06 AM, Anoop.V <anuchettan10 [at] yahoo> wrote:
>
>> Thanks for the reply,
>> Yes.I tried.That too is not working.I find it a strange problem.
>>
>>
>>
>> --- On *Fri, 10/16/09, Igor Cicimov <icicimov [at] gmail>* wrote:
>>
>>
>> From: Igor Cicimov <icicimov [at] gmail>
>> Subject: Re: [users [at] http] URL-Rewrite Problem
>> To: users [at] httpd
>> Date: Friday, October 16, 2009, 6:30 PM
>>
>>
>> Have you tried the NE flag in the rewrite rule?
>>
>> On Fri, Oct 16, 2009 at 10:41 PM, Anoop.V <anuchettan10 [at] yahoo<http://mc/compose?to=anuchettan10 [at] yahoo>
>> > wrote:
>>
>>> I have a problem with rewriting certain urls which contains special
>>> characters.Please have a look at the following urls
>>> RewriteRule ^/Football/Quarter-Reports%C2%A0
>>> /Football/Quarter-Reports [R=301,L]
>>> The problem is the server interprets it differently as the special
>>> characters change the url.
>>> If I changer the rule to something like RewriteRule
>>> ^/Football/Trend-Reports(.*) or [a-zA-Z0-9-]*
>>> it will not redirect properly.
>>> Some another examples are given below.
>>> 1) RewriteRule ^/Tennis/Play/xyx-xyz-s-Winning-game%20target=
>>> /Tennis/Play/xyx-xyz-s-Winning-game /Tennis/Play/xyx-xyz-s-Winning-game
>>> [R=301,L]
>>> 2) RewriteRule
>>> ^/Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/ST%C3%86RK
>>> /Football/xyz-xyz-to-Play/Fall-2008-Ready-to-Play/STAERK/STAERK
>>>
>>> Does anybody has any experience with this? Please suggest some solutions.
>>>
>>>
>>>
>>>
>>
>>
> This is becoming my standard response but I have to ask, why?
>
> There may be a really great explanation but those rewrite/redirect rules
> you're suggesting seem bizarre (converting raw-url-encoded to non-encoded?)
> and very very specific, how many of them do you plan to write? one for every
> URL on your page? Would it not be simpler to modify the application to more
> robustly handle the querystring/url parameters?
>

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.