Solved

Pattern Matching %20 in url

Posted on 2014-01-31
5
665 Views
Last Modified: 2014-01-31
I have several urls that have %20''s in the actual url.  I want a regex that will point it to the correct page.  I can get it to work with the first 3 letters but don't know how to add in the %20.  I have tried \W and \s but to no avail.

If it is working correctly then a url with function.php shouldn't be matched.

This is an example url in question.
funct%20in%20/var/www/html/modules/cdseolinks/function.pa%20in%20/var/www/html/modules/cdseolinks/function.parse-url

Here is what I have.

RedirectMatch 301 ^/fun\s(.+?)$ /help.php

By the way, the ideal thing I know already but I don't have any support on that program to know how to fix the problem.  So that is why I am resorting to a pattern match.  Rather than getting the program to quit putting the erroneous characters into the urls when it is spidered.

Thanks,
0
Comment
Question by:sharingsunshine
  • 3
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
Angelp1ay earned 500 total points
ID: 39824603
I can't see how the help.php in your regex is related to your example URL.

Not really sure what you're asking for. I assumed you wanted things starting fun and ending with /help.php which might have the grouping %20 in them.

This should match %20 without matching %something_else...
fun((%20)|[\s\w\/\.\-])*\/help.php

Open in new window

0
 

Author Comment

by:sharingsunshine
ID: 39824782
that matches the %20 perfectly and /or a space.  So that is great.
0
 

Author Closing Comment

by:sharingsunshine
ID: 39824784
I appreciate your help.
0
 
LVL 11

Expert Comment

by:Angelp1ay
ID: 39824958
No problem :) Have a lovely weekend!
0
 

Author Comment

by:sharingsunshine
ID: 39824995
You too!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
To get Mac Laptop, iphone, and ipad to be friend 6 42
Rate limit for DNS queries 7 75
Charging Macbook Pro 8 65
Run same command on multiple files in Linux 3 32
Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
We could spend the next millennium discussing the differences of the Mac and Windows platforms. The next century will continue to have fanatics on both side of the equation and neither side will win the war. However, that’s not why we are here. W…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question