[Linux-disciples] URL rewriting weirdness

Stephen R Laniel steve at laniels.org
Wed Feb 2 19:29:26 EST 2005


On Tue, Feb 01, 2005 at 01:37:53PM -0500, Adam Rosi-Kessel wrote:
> > When I visit hostname:9673/stuff, the URL gets rewritten to
> > the very nasty VirtualHostMonster URL of which you gave a
> > good example. That's precisely the problem I'm trying to
> > fix.
> 
> Maybe you don't have mod_proxy enabled?
> 
> The RewriteRule above works for me.

I suspect that mod_proxy is working all right, because if I
try to visit

http://hostname/stuff

I get a line in my error.log telling me that

[Wed Feb  2 18:52:11 2005] [error] [client 66.31.111.70] File does not exist: proxy:http://hostname/stuff

The VirtualHostMonster is working fine, because if I go
directly to

http://hostname:9673/VirtualHostBase/http/hostname:80/stuff

I get the right page, and the source code reveals that the
internal links (stylesheets and so forth) are pointing to
URLs of the form 'http://hostname/stuff' -- which is exactly
what we'd expect if

1) the VirtualHostMonster were working fine, and yet
2) the proxied redirection to hostname/stuff weren't
   working.

Below I include the bits of my httpd.conf that relate to
proxies, and my httpd.conf. Let me know if I ought to pass
along any other information.

-----Proxy stuff-----
<IfModule mod_proxy.c>
    #
    # Proxy Server directives. Uncomment the following lines to
    # enable the proxy server:
    #
    #ProxyRequests On

    <Directory proxy:*>
        Order deny,allow
        Deny from all
        Allow from [one IP]
    </Directory>


    #
    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block
    #
    ProxyVia On

    #
    # To enable the cache as well, edit and uncomment the following lines:
    # (no cacheing without CacheRoot)
    #
    #CacheRoot "/var/cache/apache"
    #CacheSize 5
    #CacheGcInterval 4
    #CacheMaxExpire 24
    #CacheLastModifiedFactor 0.1
    #CacheDefaultExpire 1
    #NoCache a_domain.com another_domain.edu joes.garage_sale.com

</IfModule>

-----.htaccess-----

RewriteEngine On
RewriteRule ^stuff(.*)$ http://[IP]:9673/VirtualHostBase/http/[same IP]:80/stuff$1 [P]
#RewriteCond %{SERVER_PORT} !443
#RewriteRule ^(.*)$ https://[same IP as above]/$1
-- 
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050202/366ec6ab/attachment.pgp


More information about the Linux-disciples mailing list