httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [users@httpd] RewriteMap appending %0d to end of url
Date Tue, 14 Nov 2006 18:31:27 GMT
System: Running apache2.0.59 on a windows xp machine.

I'm attempting to use RewriteMap to do some complex url rewriting.  The
problem I'm running into is that for some reason my urls end up with a %0d
appended to the end.  I have searched the net for solutions and have found
several people with the same problem but have not found a solution.

I believe this problem is specific to apache on windows and specifically
deals with the difference between a windows newline and a unix newline, 
but can't guarantee that.

Here is my modrewrite directives in my httpd.conf:
RewriteEngine On
RewriteMap splitparms "prg:c:/perl/bin/perl.exe
RewriteRule ^\/(.*)\.html /none1.php?${splitparms:$1} [R]


(noticed the %0d on the end).

Anyone have any ideas as to how I can correct this?


I don't think it matters,  but here is my perl script:

#What I want to achieve here:
#$STDIN = "testhtml__pl-32__jg-55__psd-92";
#$RETURN= "pn=testhtml&pl=32&jg=55&psd=92";

$| = 1; # Turn off buffering

while (<STDIN>)
  @parmTokens = split(/__/,$_);
  $firstToken = 1;
  $outStr = "";
  foreach $parmPair (@parmTokens)

    if ($firstToken == 1)
      $outStr = "pn=".$parmPair;
      $firstToken = 0;
      @tokens = split(/-/, $parmPair);
      if (@tokens == 2)
        $outStr .= "&".$tokens[0]."=".$tokens[1];

  print $outStr."\n";

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message