reguller express sapce issue

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

reguller express sapce issue

Post by itsmani1 »

here is is my expression:

Code: Select all

RewriteRule ^cityguides/([A-Z]+)/([a-z]+)/ citytickets.php [nc]
its working for :
/cityguides/NY/yaosadf/
/cityguides/NY/yaosadf/
etc and things like this


but its not working for:
/cityguides/NY/New%20York/

any help

thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What have you tried?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Your pattern requires that the last directory only be named with lowercase letters. %, 2, and 0 obviously don't fit in that class.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

pickle wrote:Your pattern requires that the last directory only be named with lowercase letters. %, 2, and 0 obviously don't fit in that class.
yes, but i don't know how to fit % 2 0 in it.

i tried :

Code: Select all

RewriteRule ^cityguides/([A-Z]+)/([a-z]+)([%20]*)([a-z]*)/ citytickets.php [nc]
Last edited by itsmani1 on Thu Dec 14, 2006 10:09 am, edited 1 time in total.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Untested:

Code: Select all

RewriteRule ^cityguides/([A-Z]+)/([a-zA-Z%20]+)/ citytickets.php [nc]
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

works fine for : /cityguides/FL/Miami/
but for /cityguides/FL/New%20York/
says
The requested URL /cityguides/NY/New York/ was not found on this server.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

That's not including a space. %20 is the escaped form of a space, but your request is using an actual space.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

but i am trying with %20 and its not working.
Post Reply