RE: Help with apache mod_rewrite

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Bryan O'Neal
Date:  
To: Main PLUG discussion list
Subject: RE: Help with apache mod_rewrite
Using Apache2. Rewriting mod_proxy was suggested to me, but I am not
very good with that so I am still thinking, if I have to go that deep, I
should perhaps just write a servlet filter for my app and have it set as
part of the config file I use for deployment.

________________________________

From:
[mailto:plug-discuss-bounces@lists.plug.phoenix.az.us] On Behalf Of
Joshua Zeidner
Sent: Wednesday, August 20, 2008 9:24 PM
To: Main PLUG discussion list
Subject: Re: Help with apache mod_rewrite



Bryan, you may have to write a custom handler in mod_perl. Being that
you are intercepting Tomcat requests, you may have to specify what phase
you want to modify. btw- are you using httpd 1 or 2? -jmz


On Wed, Aug 20, 2008 at 1:09 AM, Bryan O'Neal
<> wrote:


    Ok, I lied the whole thing is mute because I can not get
anything work
    with tomcat.

    
    Here is the full deal, I have my developers working on there
projects
    with all the images being stored under
/AppDir/Images/Page/image1.jpg
    and with our set up of apache forwarding the request through an
    encrypted ajp tunnel to tomcat that then forwards the image to
apache,
    which then delivers it to the user, it is just a bit slow and
there is
    no need for it.  What I want to do is rewrite it so instead of
going to
    /AppDir/Images/Page/image1.jpg on my tomcat server it just goes
to
    /Images/Page/image1.jpg on my apache server.  Any suggestions?

    

    -----Original Message-----

    
    For reasons I don't want to go into, I need to rewrite all
references to
    /dir1/dir2/ to /other_dir/ so that /dir1/dir2/file.ext goes to
    /other_dir/file.ext and /dir1/dir2/dir3/file.ext goes to
    /other_dir/dir3/file.ext and dir1/dir2/dir3/dir4/file.ext goes
to
    /other_dir/dir3/dir4/file.ext, etc.

    
    I can rewrite /dir1/dir2/file.ext to /other_dir/file.ext no
problem with
    RewriteRule ^/dir1/dir2/(.*) /other_dir/$1 however I can not
seem to get
    it to preserve directories.  I do not mind writing additional
rules to
    escape the directories like RewriteRule ^/test/([^/\.]+)/(.*)
    /other_dir/$1/$2 but that does not seem to work.  Any
suggestions?

    
    ---------------------------------------------------
    PLUG-discuss mailing list -

    To subscribe, unsubscribe, or to change your mail settings:
    http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

    




--
"Never take counsel of your fears." - Andrew Jackson

- http://www.joshuazeidner.com/

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss