Forum Moderators: phranque

Message Too Old, No Replies

rewrite causing lower case?

         

Brett_Tabke

6:45 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



This line:
RewriteRule ^(.*)/([0-9\-]+)\.htm(.*) dv4.cgi?keyword=$1&discussion=$2$3 [T=application/x-httpd-cgi]

is causing my "keyword" form value to come out in lower case when passed to the dv4.cgi script. Tips on how to address?

bt

Little_G

6:57 pm on Jun 24, 2006 (gmt 0)

10+ Year Member



Hi,

have you tried

RewriteRule ^(.*)/([0-9\-]+)\.htm(.*) dv4.cgi?keyword=$1&discussion=$2$3 [T=application/x-httpd-cgi,NC]

Andrew

jdMorgan

7:35 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd suspect one of two problems: Either the script is doing the case-conversion, or you're testing on Windows -- This latter problem having just come up Wednesday in this recent thread [webmasterworld.com]

If possible, get rid of that leading ".*" in the pattern, as it will cause repeated matching attempts (not good for a busy server). By being very specific about what ends that sub-pattern (the "/"), you allow the whole pattern to be matched left-to-right in one shot:


RewriteRule ^(([^/]+)/)+([0-9\-]+)\.htm(.*)$ dv4.cgi?keyword=$2&discussion=$3$4 [T=application/x-httpd-cgi]

The above code handles multiple levels of subdirectories, but can be simplified to just

RewriteRule ^([^/]+)/([0-9\-]+)\.htm(.*)$ dv4.cgi?keyword=$1&discussion=$2$3 [T=application/x-httpd-cgi]

if there is always only one directory level above 1234-5.htm

Jim

Brett_Tabke

7:41 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



yep - windows...thanks jd.