httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugh Williams <hu...@soco.agilent.com>
Subject mod_rewrite not substituting properly
Date Wed, 16 Jan 2002 02:03:35 GMT
Hello;

My Apache migration has proven troublesome.  Went from
 HP-UX 11.00 running Apache 1.3.14
to
 HP-UX 11.11 running Apache 1.3.22

and now mod_rewrite appears to behave differently.  The problem I have
been solving on both old and new platforms is

  old web site had path /cgi-bin/public/...
  new web site has path /cgi-bin/org/...

all else in downstream path(s) identical

So, I'm trying to rewrite that URI.  No virtual hosts; inside httpd.conf:

DocumentRoot /opt/apache/htdocs
    RewriteEngine   on
    RewriteLog      /opt/apache/logs/rewrite_log
    RewriteLogLevel 4
    RewriteRule     ^/cgi-bin/public/atm/(.*)  /cgi-bin/org/atm/$1   [PT]


rewrite_log says:

141.121.49.4 - - [15/Jan/2002:17:29:12 -0800] [jade.soco.agilent.com/sid#40025000][rid#400ef738/initial]
(2) init rewrite engine with requested uri /cgi-bin/public/atm/atm_issues.pl
141.121.49.4 - - [15/Jan/2002:17:29:12 -0800] [jade.soco.agilent.com/sid#40025000][rid#400ef738/initial]
(3) applying pattern '^/cgi-bin/public/atm/(.*)' to uri '/cgi-bin/public/atm/atm_issues.pl'
141.121.49.4 - - [15/Jan/2002:17:29:12 -0800] [jade.soco.agilent.com/sid#40025000][rid#400ef738/initial]
(2) rewrite /cgi-bin/public/atm/atm_issues.pl -> /cgi-bin/org/atm//cgi-bin/public/atm/atm_issues.pl
141.121.49.4 - - [15/Jan/2002:17:29:12 -0800] [jade.soco.agilent.com/sid#40025000][rid#400ef738/initial]
(2) forcing '/cgi-bin/org/atm//cgi-bin/public/atm/atm_issues.pl' to get passed through to
next API URI-to-filename handler


Can anyone shed light on why the rewrite is apparently appending the
entire search pattern, and not just the captured back-reference piece of
the search pattern?  I've tried:

 flags PT, R, and L in various configurations

 ^/cgi-bin/public/atm(.*) /cgi-bin/org/atm$1
     just like the documented example in 
     http://httpd.apache.org/docs/mod/mod_rewrite.html#RewriteRule

 ^/cgi-bin/public/(.*) /cgi-bin/org/$1

All have similar results.  This worked on the older OS/Apache
combination, and I can still get it to work on other older servers.  I
can also get rewrites to work in the new environment if I 'hard-code'
the rewrite; this works just great:

RewriteRule /cgi-bin/public/atm/atm_issues.pl /cgi-bin/org/atm/atm_issues.pl [R]

But having to have a rewrite line for each file is not pretty :-(

Thanks,

hugh

-- 

 Hugh Williams			"More men are killed by overwork than the
 hugh_williams@agilent.com	 importance of the world justifies."
 Agilent Technologies		 	 	- Rudyard Kipling
 Santa Rosa 2LS-R  			      "The Phantom Rickshaw", 1888
 (707)-577-4941		

---------------------------------------------------------------------
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message