Mod_rewrite confusion

Discussion in 'Apache' started by m2pilot, May 21, 2007.

  1. #1
    Hello all-

    I want to use mod-rewrite to change access to a web service from:

    myserver.com:4044/various pages

    To:

    myserver.com/myservice/various pages

    I've searched both Apache's various manuals, as well as the web in general for clues on how to do this. Nothing I've tried has worked correctly. Mod rewrite hasn't worked at all, but I've gotten partially there using proxypass. Anyway - here's the two different ways I've tried. I'm obviously doing something wrong - I believe mod-rewrite is the way to go, but I have gotten zero successful results.

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteLog "logs/rewrite_log"
    RewriteLogLevel 0
    RewriteRule ^/myservice(.*) http://myserver.com:4044/$1 [P]
    </IfModule>

    On proxypass I get results, but the internal addresses in the html returned is not fixed & thus graphics don't load & links don't work:

    ProxyPass /myservice/ http://myserver.com:4044/
    ProxyPassReverse /myservice/ http://myserver.com:4044/
    ProxyPreserveHost On


    Thanks for any insights...

    mark
     
    m2pilot, May 21, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    If you haven't solved your problem yet, could it be that the internal addresses are relative to the web root, which is now myserver.com/, not myserver.com/myservice/ as you might expect/want ?
     
    krt, Jun 2, 2007 IP