Redirect URL that contains %20

This is a discussion on Redirect URL that contains %20 within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello, I need to redirect a legacy URL to a new URL. The legacy URL is similar to: http://www....


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-24-2006
mail4mike@gmail.com
 
Posts: n/a
Default Redirect URL that contains %20

Hello,

I need to redirect a legacy URL to a new URL. The legacy URL is similar
to:
http://www.foo.com/testing/old%20web%20page.htm
I've tried to use a Redirect with /testing/old%20web%20page.htm, but
Apache (2.0.52) doesn't seem to recognize it.

I've also tried a few variations with the RedirectMatch directive, but
I can't seem to find a working regexp. I thought the following might
work, but I'm also a little rusty on my regexps.
RedirectMatch ^/testing/old\.*?page.htm$

Any ideas?

Mike K.

  #2 (permalink)  
Old 08-24-2006
Rik
 
Posts: n/a
Default Re: Redirect URL that contains %20

mail4mike@gmail.com wrote:
> Hello,
>
> I need to redirect a legacy URL to a new URL. The legacy URL is
> similar to:
> http://www.foo.com/testing/old%20web%20page.htm
> I've tried to use a Redirect with /testing/old%20web%20page.htm, but
> Apache (2.0.52) doesn't seem to recognize it.
>
> I've also tried a few variations with the RedirectMatch directive, but
> I can't seem to find a working regexp. I thought the following might
> work, but I'm also a little rusty on my regexps.
> RedirectMatch ^/testing/old\.*?page.htm$


Lose the \ before the ., it makes it a literal.
Isn't %20 converted back to spaces before it enters the rewriteengine?

Grtz,
--
Rik Wasmus


  #3 (permalink)  
Old 08-24-2006
mail4mike@gmail.com
 
Posts: n/a
Default Re: Redirect URL that contains %20

Not sure about how Apache treats %20, but your regexp correction worked
perfectly. My URL is redirecting correctly now.

Thank you,
Mike K.


Rik wrote:
> mail4mike@gmail.com wrote:
> > Hello,
> >
> > I need to redirect a legacy URL to a new URL. The legacy URL is
> > similar to:
> > http://www.foo.com/testing/old%20web%20page.htm
> > I've tried to use a Redirect with /testing/old%20web%20page.htm, but
> > Apache (2.0.52) doesn't seem to recognize it.
> >
> > I've also tried a few variations with the RedirectMatch directive, but
> > I can't seem to find a working regexp. I thought the following might
> > work, but I'm also a little rusty on my regexps.
> > RedirectMatch ^/testing/old\.*?page.htm$

>
> Lose the \ before the ., it makes it a literal.
> Isn't %20 converted back to spaces before it enters the rewriteengine?
>
> Grtz,
> --
> Rik Wasmus


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:39 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0