Two URLs, Need the longer one

Topics: Developer Forum
Aug 10, 2007 at 6:53 PM
Edited Aug 10, 2007 at 6:55 PM
I have the following two rules:


RewriteRule ^/EquityOffice\/sexualharassment ^\/ .*$ /pages/518.asp I

RewriteRule ^/EquityOffice\/sexualharassmentstudentinfo ^\/ .*$ /pages/523.asp I

When I request either :
/EquityOffice/sexualharassment.asp
/EquityOffice/sexualharassmentstudentinfo.asp
Both return 518.asp

I understand why it grabs the shorter one first (because of the period). I am not sure how to properly escape the . How can I get it to match each URL correctly?
Coordinator
Aug 20, 2007 at 8:36 PM
it will be easier for me to help you if you quote your rewrite rules.
double-open-curly
<rules here>
double-close-curly
Aug 21, 2007 at 2:19 PM
 
RewriteRule ^/EquityOffice\/sexualharassment^\/ .*$   /pages/518.asp I
 
RewriteRule ^/EquityOffice\/sexualharassmentstudentinfo^\/ .*$   /pages/523.asp I
 
Aug 21, 2007 at 2:20 PM
I think I may have figured out what the issue was though:

I have modified the rules to be as follows:

RewriteRule ^/EquityOffice\/sexualharassment(\..*)$  /pages/518.asp [I]
 
RewriteRule ^/EquityOffice\/SexualHarassmentBehavior(\..*)$  /pages/519.asp [I]
 
RewriteRule ^/EquityOffice\/SexualHarassmentPolicy(\..*)$  /pages/520.asp [I]
 
RewriteRule ^/EquityOffice\/sexualharassmentqanda(\..*)$  /pages/521.asp [I]
 
RewriteRule ^/EquityOffice\/SexualHarassmentQuestionsandAnswers(\..*)$  /pages/522.asp [I]
 
Coordinator
Sep 1, 2007 at 4:56 PM
I'm glad it worked out for you!