[users@httpd] RewriteMap appending %0d to end of url

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
---------<snip>--------------
RewriteEngine On
RewriteMap splitparms "prg:c:/perl/bin/perl.exe
C:/htdocs/websitecreator/app/scripts/apachemod.pl"
RewriteRule ^\/(.*)\.html /none1.php?${splitparms:$1} [R]
---------<snip>--------------

Example:
http://mywebsite.com/somethinghere.html
Produces:
http://mywebsite.com/none1.php?pn=somethinghere%0d

(noticed the %0d on the end).

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

Thanks,
Jason


I don't think it matters,  but here is my perl script:
---------<snip>--------------
#!/usr/bin/perl

#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)
  {
    chomp($parmPair);

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

  print $outStr."\n";
}
---------<snip>--------------


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux