silent URL redirect/cloak with mod_rewrite

silent URL redirect/cloak with mod_rewrite

am 21.04.2008 01:42:34 von Hank

------=_Part_8065_17000191.1208734954297
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello All,

I've tried about 100 combinations and searched google over and over, but I
can't find nor figure out how to do this simple task.

I have one webserver with sites at:

/home/user/public_html/ ( http://basedomain.com site points here)
/home/user/public_html/siteA
/home/user/public_html/siteB

I have domain names like this: http://domainA.com and
http://domainB.com

I want to *silently* redirect http://domainA.com to
/home/user/public_html/siteA
and http://domainB.com to
/home/user/public_html/siteB

Now keep in mind the literals "domainA" is not the same as the directory
name "siteA", and same for domainA/siteA.

I have found several ways to non-silently redirect
http://domainA.comto
http://basedomain/siteA, but that's not good enough. It needs to be a
silent re-direct.

I realize I could do this with virtual domains if I had access to
httpd.conf, but I don't on this server.

Thanks,
-Hank

------=_Part_8065_17000191.1208734954297
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello All,

 

I've tried about 100 combinations and searched google over and over, but I can't find nor figure out how to do this simple task.

 

I have one webserver with sites at:


 

/home/user/public_html/  ( site points here) 

/home/user/public_html/siteA

/home/user/public_html/siteB

 

I have domain names like this: 

 

I want to *silently* redirect  to  /home/user/public_html/siteA

and  to  /home/user/public_html/siteB

 

Now keep in mind the literals "domainA" is not the same as the directory name "siteA", and same for domainA/siteA.

 

I have found several ways to non-silently redirect , but that's not good enough.  It needs to be a silent re-direct.


 

I realize I could do this with virtual domains if I had access to httpd.conf, but I don't on this server.

 

Thanks,

-Hank


------=_Part_8065_17000191.1208734954297--

AW: silent URL redirect/cloak with mod_rewrite

am 21.04.2008 08:20:22 von christian.folini

------_=_NextPart_001_01C8A377.C75AC784
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hey Hank,
=20
What do you mean by "silent redirect"?
=20
Christian

________________________________

Von: Hank [mailto:heskin@gmail.com]=20
Gesendet: Montag, 21. April 2008 01:43
An: users@httpd.apache.org
Betreff: [users@httpd] silent URL redirect/cloak with mod_rewrite


Hello All,
=20
I've tried about 100 combinations and searched google over and over, but
I can't find nor figure out how to do this simple task.
=20
I have one webserver with sites at:
=20
/home/user/public_html/ ( http://basedomain.com
site points here)=20
/home/user/public_html/siteA
/home/user/public_html/siteB
=20
I have domain names like this: http://domainA.com
and http://domainB.com =20
=20
I want to *silently* redirect http://domainA.com
to /home/user/public_html/siteA=20
and http://domainB.com to
/home/user/public_html/siteB
=20
Now keep in mind the literals "domainA" is not the same as the directory
name "siteA", and same for domainA/siteA.
=20
I have found several ways to non-silently redirect http://domainA.com
to http://basedomain/siteA, but that's not good
enough. It needs to be a silent re-direct.=20
=20
I realize I could do this with virtual domains if I had access to
httpd.conf, but I don't on this server.
=20
Thanks,
-Hank

------_=_NextPart_001_01C8A377.C75AC784
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



charset=3Dus-ascii">


face=3DArial=20
color=3D#0000ff size=3D2>Hey Hank,

face=3DArial=20
color=3D#0000ff size=3D2>
 

face=3DArial=20
color=3D#0000ff size=3D2>What do you mean by "silent =
redirect"?

face=3DArial=20
color=3D#0000ff size=3D2>
 

face=3DArial=20
color=3D#0000ff size=3D2>Christian





Von: Hank [mailto:heskin@gmail.com]=20

Gesendet: Montag, 21. April 2008 01:43
An:=20
users@httpd.apache.org
Betreff: [users@httpd] silent URL=20
redirect/cloak with mod_rewrite



Hello All,

 

I've tried about 100 combinations and searched google over and =
over, but I=20
can't find nor figure out how to do this simple task.

 

I have one webserver with sites at:


 

/home/user/public_html/  ( href=3D"http://basedomain.com/">http://basedomain.com =
site points=20
here) 

/home/user/public_html/siteA

/home/user/public_html/siteB

 

I have domain names like this:  href=3D"http://domaina.com/">http://domainA.com and href=3D"http://domainb.com/">http://domainB.com

 

I want to *silently* redirect href=3D"http://domaina.com/">http://domainA.com to =20
/home/user/public_html/siteA

and href=3D"http://domainb.com/">http://domainB.com to =20
/home/user/public_html/siteB

 

Now keep in mind the literals "domainA" is not the same as the =
directory=20
name "siteA", and same for domainA/siteA.

 

I have found several ways to non-silently redirect href=3D"http://domaina.com/">http://domainA.com to href=3D"http://basedomain/siteA">http://basedomain/siteA, but that's =
not good=20
enough.  It needs to be a silent re-direct.

 

I realize I could do this with virtual domains if I had access to=20
httpd.conf, but I don't on this server.

 

Thanks,

-Hank


------_=_NextPart_001_01C8A377.C75AC784--

RE: silent URL redirect/cloak with mod_rewrite

am 21.04.2008 09:04:56 von Boyle Owen

------_=_NextPart_001_01C8A37E.0144FF50
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

________________________________

From: Hank [mailto:heskin@gmail.com]=20
Sent: Monday, April 21, 2008 1:43 AM
To: users@httpd.apache.org
Subject: [users@httpd] silent URL redirect/cloak with
mod_rewrite
=09
=09
Hello All,
=20
I've tried about 100 combinations and searched google over and
over, but I can't find nor figure out how to do this simple task.
=20
I have one webserver with sites at:
=20
/home/user/public_html/ ( http://basedomain.com
site points here)=20
/home/user/public_html/siteA
/home/user/public_html/siteB
=20
I have domain names like this: http://domainA.com
and http://domainB.com =20
=20
I want to *silently* redirect http://domainA.com
to /home/user/public_html/siteA=20
and http://domainB.com to
/home/user/public_html/siteB
=20
Now keep in mind the literals "domainA" is not the same as the
directory name "siteA", and same for domainA/siteA.
=20
I have found several ways to non-silently redirect
http://domainA.com to http://basedomain/siteA,
but that's not good enough. It needs to be a silent re-direct.=20
=20
I realize I could do this with virtual domains if I had access
to httpd.conf, but I don't on this server.
=20
Thanks,
-Hank

If I 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.=20
=20
Then I don't think this is possible. Here's why:
=20
The NameVirtualHost mechanism is specifically designed for this
situation, but this has to be used in the main config - it is impossible
to do this in .htaccess. The problem is that although the request (for
domainA, say) might come in with a header like "Host: domainA", without
a NameVirtualHost directive and a corresponding VH, this will be ignored
and the request will go the main docroot.
=20
BTW, "redirect" has a very specific meaning in HTTP - it means to send a
301 or 302 redirect response that causes the browser to submit a new
request to a new URL. It is always non-"silent" - ie, the browser
location display shows the new URL. By "silent redirect", I think you
mean proxying - where the server gets content from a new URL and returns
it to the browser without telling it where it came from. That's a
different thing and is never referred to as redirection.
Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.
=20
=20
This message is for the named person's use only. It may contain =
confidential, proprietary or legally privileged information. If you =
receive this message in error, please notify the sender urgently and =
then immediately delete the message and any copies of it from your =
system. Please also immediately destroy any hardcopies of the message. =
The sender's company reserves the right to monitor all e-mail =
communications through their networks.

------_=_NextPart_001_01C8A37E.0144FF50
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



charset=3DUTF-16">


charset=3Dus-ascii">



face=3DArial=20
color=3D#0000ff size=3D2>
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">



From: Hank =
[mailto:heskin@gmail.com]=20

Sent: Monday, April 21, 2008 1:43 AM
To:=20
users@httpd.apache.org
Subject: [users@httpd] silent URL=20
redirect/cloak with mod_rewrite



Hello All,

 

I've tried about 100 combinations and searched google over and =
over, but=20
I can't find nor figure out how to do this simple task.

 

I have one webserver with sites at:


 

/home/user/public_html/  ( href=3D"http://basedomain.com/">http://basedomain.com =
site points=20
here) 

/home/user/public_html/siteA

/home/user/public_html/siteB

 

I have domain names like this:  href=3D"http://domaina.com/">http://domainA.com and href=3D"http://domainb.com/">http://domainB.com

 

I want to *silently* redirect href=3D"http://domaina.com/">http://domainA.com to =20
/home/user/public_html/siteA

and href=3D"http://domainb.com/">http://domainB.com to =20
/home/user/public_html/siteB

 

Now keep in mind the literals "domainA" is not the same as the =
directory=20
name "siteA", and same for domainA/siteA.

 

I have found several ways to non-silently redirect href=3D"http://domaina.com/">http://domainA.com to href=3D"http://basedomain/siteA">http://basedomain/siteA, but =
that's not=20
good enough.  It needs to be a silent re-direct.

 

I realize I could do this with virtual domains if I had access to =

httpd.conf, but I don't on this server.

 

Thanks,

-Hank

face=3DArial=20
color=3D#0000ff size=3D2>If I understand you correctly, you have =
registered domainA=20
and domainB and the domain names point to your server's IP in DNS. You =
want to=20
map domainA to ../siteA and domainB to ../siteB. You don't have=20
color=3D#0000ff=20
size=3D2>access to the server's httpd.conf directly and only have access =
to=20
..htaccess files.

size=3D2> 

color=3D#0000ff>T class=3D659374606-21042008>hen I don't think this is possible. Here's=20
why:

color=3D#0000ff> class=3D659374606-21042008> 

face=3DArial=20
color=3D#0000ff size=3D2>The NameVirtualHost mechanism is specifically =
designed for=20
this situation, but this has to be used in the main config - it is =
impossible to=20
do this in .htaccess. The problem is that although the request (for =
domainA,=20
say) might come in with a header like "Host: domainA", without a =
NameVirtualHost=20
directive and a corresponding VH, this will be ignored and the request =
will go=20
the main docroot.

face=3DArial=20
color=3D#0000ff size=3D2>
 

face=3DArial=20
color=3D#0000ff size=3D2>BTW, "redirect" has a very specific meaning in =
HTTP - it=20
means to send a 301 or 302 redirect response that causes the browser to =
submit a=20
new request to a new URL. It is always non-"silent" - ie, the browser =
location=20
display shows the new URL. By "silent redirect", I think you mean =
proxying -=20
where the server gets content from a new URL and returns it to the =
browser=20
without telling it where it came from. That's a different thing and is =
never=20
referred to as redirection.


Rgds,
Owen Boyle
Disclaimer: Any disclaimer =
attached to=20
this message may be ignored.


 

 


This =
message is for the named person's use only. It may contain confidential, =
proprietary or legally privileged information. If you receive this =
message in error, please notify the sender urgently and then immediately =
delete the message and any copies of it from your system. Please also =
immediately destroy any hardcopies of the message. The sender's company =
reserves the right to monitor all e-mail communications through their =
networks.




------_=_NextPart_001_01C8A37E.0144FF50--

Re: silent URL redirect/cloak with mod_rewrite

am 21.04.2008 13:26:58 von Krist van Besien

On Mon, Apr 21, 2008 at 1:42 AM, Hank wrote:

> I have found several ways to non-silently redirect http://domainA.com to
> http://basedomain/siteA, but that's not good enough. It needs to be a
> silent re-direct.

As someone else allready pointed out: There is no such thing as a
"silent" re-direct. What you want is called proxying. The only way I
could imagine doing this would be using rewrite rules.

/home/user/public_html/.htaccess would then have to contain something like this:

RewriteEngine On
RewriteBase /

RewriteCond $HTTP_HOST DomainA.com
RewriteRule ^(.*)$ http://basedomain.com/SiteA/$1 [P]

RewriteCond $HTTP_HOST DomainB.com
RewriteRule ^(.*)$ http://basedomain.com/SiteB/$1 [P]


Krist

--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: silent URL redirect/cloak with mod_rewrite

am 21.04.2008 16:04:42 von Hank

------=_Part_10370_23352165.1208786682282
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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} ^domainA.com$
RewriteRule ^(.*)$ http://basedomain.com/siteA/$1 [P]
WIth a [P] option, I get a 404 error. With a [L] option, I get a redirect
but the domain changes to basedomain.com/siteA and not domainA.com/.

I've tried

RewriteCond %{HTTP_HOST} ^domainA.com$
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
domainA.com to basedomain.com/siteA . 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.

thanks,

-Hank

------=_Part_10370_23352165.1208786682282
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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}   ^domainA.com$
RewriteRule   ^(.*)$     [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 domainA.com/.

 

I've tried

 

RewriteCond  %{HTTP_HOST}   ^domainA.com$
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 domainA.com 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.


 

thanks,

 

-Hank

 


------=_Part_10370_23352165.1208786682282--

Re: silent URL redirect/cloak with mod_rewrite

am 21.04.2008 16:22:13 von Joshua Slive

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} ^domainA.com$
> RewriteRule ^(.*)$ http://basedomain.com/siteA/$1 [P]
>
> WIth a [P] option, I get a 404 error. With a [L] option, I get a redirect
> but the domain changes to basedomain.com/siteA and not domainA.com/.
>
> I've tried
>
> RewriteCond %{HTTP_HOST} ^domainA.com$
> 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
> domainA.com to basedomain.com/siteA . 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 domainA.com (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} ^domainA.com$
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.

Joshua.

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: silent URL redirect/cloak with mod_rewrite

am 21.04.2008 16:47:36 von Hank

------=_Part_10569_21513536.1208789256194
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

If the content is living on the same server as domainA.com (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} ^domainA.com$
> 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?
>

I tried exactly that, and I'm getting an Error 500 (Internal server error).
I'll have to do more testing to figure out exactly what the problem is later
this afternoon. Thanks for the assistance.

-Hank

------=_Part_10569_21513536.1208789256194
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

 

If the content is living on the same server as domainA.com (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}   ^domainA.com$
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?


 

I tried exactly that, and I'm getting an Error 500 (Internal server error).  I'll have to do more testing to figure out exactly what the problem is later this afternoon.  Thanks for the assistance.

 

-Hank


------=_Part_10569_21513536.1208789256194--

Re: silent URL redirect/cloak with mod_rewrite

am 22.04.2008 23:43:46 von Hank

------=_Part_17455_31571403.1208900626221
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Mon, Apr 21, 2008 at 10:47 AM, Hank wrote:

>
> If the content is living on the same server as domainA.com (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} ^domainA.com$
> > 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?
> >
>
>



I found part of the problem, but not how to solve it.

When configured as such:

RewriteCond %{HTTP_HOST} ^domainA.net$
RewriteRule ^(.*)$ /home/user/public_html/siteA/$1 [L]


Apache is returning a 500 error.. the error_log shows:

"mod_rewrite: maximum number of internal redirects reached. Assuming
configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit
if neccessary."

I also found the httpd.conf on the server, and it doesn't seem to be doing
any other mod_rewrite stuff.

Why is it going into a recursive loop?

thanks.
-Hank

------=_Part_17455_31571403.1208900626221
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Mon, Apr 21, 2008 at 10:47 AM, Hank <> wrote:




 

If the content is living on the same server as domainA.com (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}   ^domainA.com$
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?


 

 

 



I found part of the problem, but not how to solve it.

 

When configured as such:

 

RewriteCond  %{HTTP_HOST}   ^domainA.net$
RewriteRule   ^(.*)$  /home/user/public_html/siteA/$1 [L]


 

Apache is returning a 500 error.. the error_log shows:

 

"mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary."

 

I also found the httpd.conf on the server, and it doesn't seem to be doing any other mod_rewrite stuff.

 

Why is it going into a recursive loop?

 

thanks.

-Hank


------=_Part_17455_31571403.1208900626221--

Re: silent URL redirect/cloak with mod_rewrite

am 23.04.2008 00:04:21 von Hank

------=_Part_17510_4184425.1208901861614
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I solved the problem.

I have in the .htaccess file in the root directory (../public_html/)

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

but then in the /siteA subdirectory, I now have another .htaccess file with
only:

RewriteEngine Off

Then everything works perfectly!

Thanks to everyone for your suggestions. It is possible to create a
"virtual" virtual named host without write access to httpd.conf on a shared
hosting environment.

-Hank

------=_Part_17510_4184425.1208901861614
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

 

I solved the problem.

 

I have in the .htaccess file in the root directory (../public_html/)

 

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

 

but then in the /siteA subdirectory, I now have another .htaccess file with only:

 

RewriteEngine Off

 

Then everything works perfectly!

 

Thanks to everyone for your suggestions.  It is possible to create a "virtual" virtual named host without write access to httpd.conf on a shared hosting environment.

 

-Hank


------=_Part_17510_4184425.1208901861614--

Search & Replace + Redirect with Mod_Rewrite?

am 29.04.2008 18:52:00 von Vik Rubenfeld

--Apple-Mail-43--747512975
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit

I need to change the variable names in query strings. This is because
I need to get two different supplier companies talking to each other.
(One supplier uses variable names that the other supplier doesn't
recognize).

So I'm getting supplier A to send the URL to one of my domains, where
I can change the variable names in the query string, and then redirect
to the web site of supplier B.

For example, I'd like to change:

> http://www.my_domain_name.com/wsb.dll/s/12345?DDR2=test_2_da ta&DDR3=
> test_3_data

....to:

> https://supplier_B.com/wsb.dll/s/12345?wsb5=test_2_data&wsb6 =
test_3_data

Here's my current mod rewrite code, which gives me a "Internal Server
Error" message:

> Options +FollowSymLinks
> Options +Indexes
> RewriteEngine On
>
> RewriteRule ^(.*)DDR2(.*)$ $1wsb5$2 [NC]
>
> RewriteRule ^(.*)DDR3(.*)$ $1wsb6$2 [NC,L]
>
> Redirect (.*)my_domain_name.com/wsb.dll/(.*) $supplier_B.com/
wsb.dll/$2

What is the correct way to do this?

Thanks very much in advance to all for any info.
--Apple-Mail-43--747512975
Content-Type: text/html;
charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

-webkit-line-break: after-white-space; ">

margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 12px/normal Helvetica; ">I need to change the variable =
names in query strings. This is because I  need to get two =
different supplier companies talking to each other. (One supplier =
uses variable names that the other supplier doesn't =
recognize).
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; min-height: 14px; ">
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">So =
I'm getting supplier A to send the URL to one of my domains, where I can =
change the variable names in the query string, and then redirect to the =
web site of supplier B.
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 12px/normal Helvetica; ">
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: =
normal normal normal 12px/normal Helvetica; ">For example, I'd like to =
change:
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; min-height: 14px; ">
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">> =
href=3D"http://www.my_domain_name.com/wsb.dll/s/12345?DDR2=3 Dtest_2_data&a=
mp;DDR3=3D">http://www.my_domain_name.com/wsb.dll/s/12345?DD R2=3Dtest_2_da=
ta&DDR3=3D
0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; ">> test_3_data
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: =
normal normal normal 12px/normal Helvetica; min-height: 14px; =
">
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; ">...to: 
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: =
normal normal normal 12px/normal Helvetica; min-height: 14px; =
">
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; ">> href=3D"https://supplier_B.com/wsb.dll/s/12345?wsb5=3Dtest_2 _data&wsb6=
=3D">https://supplier_B.com/wsb.dll/s/12345?wsb5=3Dtest_2_da ta&wsb6=3D=
test_3_data
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; min-height: 14px; ">
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; font: normal normal normal 12px/normal Helvetica; =
">Here's my current mod rewrite code, which gives me a " class=3D"Apple-style-span" style=3D"font-family: Verdana; ">Internal =
Server Error" Helvetica; "> message: 
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; font: normal normal normal 12px/normal Helvetica; =
min-height: 14px; ">
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 12px/normal Helvetica; ">
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 12px/normal Helvetica; ">
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 12px/normal Helvetica; ">> Options =
+FollowSymLinks
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; ">> Options +Indexes
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: =
normal normal normal 12px/normal Helvetica; ">> RewriteEngine =
On
0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; =
">> 
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; ">> RewriteRule ^(.*)DDR2(.*)$ $1wsb5$2 =
[NC]
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; ">> 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 12px/normal Helvetica; ">> RewriteRule ^(.*)DDR3(.*)$ =
$1wsb6$2 [NC,L]
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; ">> 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 12px/normal Helvetica; ">> Redirect =
(.*)my_domain_name.com/wsb.dll/(.*) =
$supplier_B.com/wsb.dll/$2
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: =
normal normal normal 12px/normal Helvetica; min-height: 14px; =
">
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; ">What is the correct way to do =
this? 
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; min-height: 14px; ">
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; font: normal normal normal 12px/normal Helvetica; =
">Thanks very much in advance to all for any info.
=

--Apple-Mail-43--747512975--

Re: Search & Replace + Redirect with Mod_Rewrite?

am 29.04.2008 19:26:34 von Joshua Slive

On Tue, Apr 29, 2008 at 12:52 PM, Vik Rubenfeld wrote:
>
> I need to change the variable names in query strings. This is because I
> need to get two different supplier companies talking to each other. (One
> supplier uses variable names that the other supplier doesn't recognize).
>
> So I'm getting supplier A to send the URL to one of my domains, where I can
> change the variable names in the query string, and then redirect to the web
> site of supplier B.
>
> For example, I'd like to change:
>
> > http://www.my_domain_name.com/wsb.dll/s/12345?DDR2=test_2_da ta&DDR3=
> > test_3_data
>
> ...to:
>
> > https://supplier_B.com/wsb.dll/s/12345?wsb5=test_2_data&wsb6 = test_3_data
>
> Here's my current mod rewrite code, which gives me a "Internal Server Error"
> message:
>
>
> > Options +FollowSymLinks
> > Options +Indexes
> > RewriteEngine On
> >
> > RewriteRule ^(.*)DDR2(.*)$ $1wsb5$2 [NC]
> >
> > RewriteRule ^(.*)DDR3(.*)$ $1wsb6$2 [NC,L]
> >
> > Redirect (.*)my_domain_name.com/wsb.dll/(.*) $supplier_B.com/wsb.dll/$2
>
> What is the correct way to do this?
>
> Thanks very much in advance to all for any info.

You'll want to start here:
http://wiki.apache.org/httpd/RewriteQueryString

Then you'll want to be sure to use the RewriteLog to debug.

Joshua.

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org