Any questions involving matching text strings to patterns - the pattern is called a "regular expression."
Moderator: General Moderators
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Thu Dec 14, 2006 9:02 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Dec 14, 2006 9:31 am
What have you tried?
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Thu Dec 14, 2006 9:59 am
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.
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Thu Dec 14, 2006 10:05 am
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.
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Thu Dec 14, 2006 10:09 am
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.
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Thu Dec 14, 2006 10:28 am
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Dec 14, 2006 10:38 am
That's not including a space. %20 is the escaped form of a space, but your request is using an actual space.
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Fri Dec 15, 2006 3:35 am
but i am trying with %20 and its not working.