httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <>
Subject Re: [users@httpd] silent URL redirect/cloak with mod_rewrite
Date Mon, 21 Apr 2008 14:22:13 GMT
On Mon, Apr 21, 2008 at 10:04 AM, Hank <> wrote:
> n Mon, Apr 21, 2008 at 3:04 AM, Boyle Owen <> wrote:

> >  understand you correctly, you have registered domainA and domainB and the
> domain names point to your server's IP in DNS. You want to map domainA to
> ../siteA and domainB to ../siteB. You don't have access to the server's
> httpd.conf directly and only have access to .htaccess files.
>  Owen,
>   Thanks for your response.. yes, that is exactly what I want to do, and
> yes, I meant proxying the requests and not redirecting them -- thanks for
> the clarification.
>  I've tried many combinations of the following, which I can get to work as a
> re-direct, but never a proxy:
> RewriteCond  %{HTTP_HOST}   ^$
> RewriteRule   ^(.*)$$1   [P]
> WIth a [P] option, I get a 404 error.  With a [L] option, I get a redirect
> but the domain changes to and not
> I've tried
> RewriteCond  %{HTTP_HOST}   ^$
> RewriteRule   ^(.*)$  /home/user/public_html/siteA/$1  [P]
> with both [L] and [P] and it still won't work like I want it to.
> I guess I'm surprised I can't get mod_rewrite to silently proxy a call to
> to .  I'll guess I'll write a little PHP
> script to do it for me if I can't get mod_rewrite to do it for me.

If the content is living on the same server as (which it
apparently is in this case), then you don't want to proxy. There is no
need to create an additional HTTP request. You just instruct apache to
grab the file directly. So you want something like

RewriteCond  %{HTTP_HOST}   ^$
RewriteRule   ^(.*)$  /home/user/public_html/siteA/$1

If this doesn't work, tell us EXACTLY what happens: what do you see in
the browser, error_log, and access_log?

If you still can't figure it out, you'll need to use the RewriteLog.
Since you only have access to .htaccess on the live server, you'll
need to setup a test server where you can manipulate httpd.conf in
order to activate the RewriteLog.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message