rewriterules

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

Hi everyone, this is my first message to the mailing list



I have a problem with the rewriterules. My English is not the best but I
will explain fine



We have a Plone site on a server listen on 8080 port and apache listen
on 80 and 443 (on the same server) (by default plone doesn't support ssl
encryption)

The section of the rewrite is this:

<IfModule mod_rewrite.c>

RewriteEngine
On

RewriteRule ^/(.*)
http://localhost:8080/VirtualHostBase/https/%{SERVER_NAME}:4 43/$1 [P]

</IfModule>

This works fine. But now I need to put the apache on other server behind
DMZ

I thought that this work fine but doesn't work

<IfModule mod_rewrite.c>

RewriteEngine
On

RewriteRule ^/(.*)
http://ploneserver:8080/VirtualHostBase/https/%{SERVER_NAME} :443/$1 [P]

</IfModule>



What can I do for rewrite to another server?



Thanks a lot




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

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EstiloCorreo17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
{page:Section1;}
-->
</style>

</head>

<body lang=3DES link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>Hi
everyone, this is my first message to the mailing list =
<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></fo=
nt></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>I
have a problem with the rewriterules. My English is not the best but I =
will explain
fine <o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></fo=
nt></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>We
have a Plone site on a server listen on 8080 port and apache listen on =
80 and
443 (on the same server) (by default plone doesn’t support ssl
encryption) <o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>The
section of the rewrite is this:<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'><IfModule
mod_rewrite.c><o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>    &nbs=
p;            =
;            =
            &=
nbsp;           &n=
bsp;     RewriteEngine
On<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>   
        RewriteRule ^/(.*) =
http://localhost:8080/VirtualHostBase/https/%{SERVER_NAME}:4 43/$1
[P]<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'></IfModule><o:p></o:p>=
</span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>This
works fine. But now I need to put the apache on other server behind DMZ =
<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>I
thought that this work fine but doesn’t work =
<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'><IfModule
mod_rewrite.c><o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>    &nbs=
p;            =
;            =
            &=
nbsp;           &n=
bsp;     RewriteEngine
On<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>   
        RewriteRule ^/(.*)
http://ploneserver:8080/VirtualHostBase/https/%{SERVER_NAME} :443/$1 =
[P]<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'></IfModule><o:p></o:p>=
</span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></fo=
nt></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>What
can I do for rewrite to another server?<o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></fo=
nt></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto' ><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>Thanks
a lot </span></font><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01CA7CB3.B6847B2A--
jose-rabadan [ Mo, 14 Dezember 2009 12:51 ] [ ID #2025859 ]

Re: rewriterules

Rabadan Palenque, Jose wrote:
>
> <IfModule mod_rewrite.c>
>
> RewriteEngine On
>
> RewriteRule ^/(.*)
> http://localhost:8080/VirtualHostBase/https/%{SERVER_NAME}:4 43/$1 [P]
>
> </IfModule>
>
> This works fine. But now I need to put the apache on other server
> behind DMZ
>
> I thought that this work fine but doesn’t work
>
> <IfModule mod_rewrite.c>
>
> RewriteEngine On
>
> RewriteRule ^/(.*)
> http://ploneserver:8080/VirtualHostBase/https/%{SERVER_NAME} :443/$1 [P]
>
> </IfModule>
>

I'm not seeing anything blatantly wrong, although I haven't messed with
proxy RewriteRules much myself. My first question would be whether the
Apache server can access
http://ploneserver:8080/VirtualHostBase/https/%{SERVER_NAME} :443/. If
you try to pull up that URL using something like wget or lynx (replacing
${SERVER_NAME} accordingly), do you get a successful response? Do you
see anything in the apache error logs?


--
Justin Pasher

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Justin Pasher [ Mi, 16 Dezember 2009 00:17 ] [ ID #2026101 ]

Re: rewriterules

On Mon, Dec 14, 2009 at 12:51 PM, Rabadan Palenque, Jose
<jose-rabadan [at] rba.es> wrote:

> =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 RewriteRule ^/(.*) http://ploneserver:808=
0/VirtualHostBase/https/%{SERVER_NAME}:443/$1 [P]

It is perfectly possible to use RewriteRules to proxy a particular URL
to another server. And the general pattern is indeed:
RewriteRule <URL pattern> http://<destination server>/<destination URL>.

If you have trouble making this work we can help. However, you need to
provide us with more information. And your URL looks funny, I'm not
sure that URLs with a : followed by what looks like a port number are
a good idea...

- What do you mean with "it does not work". What were you expecting,
and what did you get in stead? Be specific.
- Switch on the RewriteLog, and look in the log what you see there. If
you see something there you don't understand feel free to ask here.
- Also check that your backend is not messing things up by sending
redirects to URLs that the client can't reach.

Krist

--
krist.vanbesien [at] gmail.com
krist [at] 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 <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Krist van Besien [ Mi, 16 Dezember 2009 10:21 ] [ ID #2026103 ]

RE: rewriterules

Hi,

Whit the help of other member of the list (Antonio) I understood =
rewriterules is not what I need, the best option is mod_proxy

This is what I have:
Server.apache
Server.plone

And I want this:
When accessing https://server.apache redirect to http://server.plone but =
"hiding" the url and showing https://server.apache

Now I'm reading documentation about mod_proxy

Thanks!

Saludos,

Jose Rabad=E1n



-----Mensaje original-----
De: Krist van Besien [mailto:krist.vanbesien [at] gmail.com]
Enviado el: mi=E9rcoles, 16 de diciembre de 2009 10:21
Para: users [at] httpd.apache.org
Asunto: Re: [users [at] httpd] rewriterules

On Mon, Dec 14, 2009 at 12:51 PM, Rabadan Palenque, Jose
<jose-rabadan [at] rba.es> wrote:

> =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 RewriteRule ^/(.*) =
http://ploneserver:8080/VirtualHostBase/https/%{SERVER_NAME} :443/$1 [P]

It is perfectly possible to use RewriteRules to proxy a particular URL
to another server. And the general pattern is indeed:
RewriteRule <URL pattern> http://<destination server>/<destination =
URL>.

If you have trouble making this work we can help. However, you need to
provide us with more information. And your URL looks funny, I'm not
sure that URLs with a : followed by what looks like a port number are
a good idea...

- What do you mean with "it does not work". What were you expecting,
and what did you get in stead? Be specific.
- Switch on the RewriteLog, and look in the log what you see there. If
you see something there you don't understand feel free to ask here.
- Also check that your backend is not messing things up by sending
redirects to URLs that the client can't reach.

Krist

--
krist.vanbesien [at] gmail.com
krist [at] 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 <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
jose-rabadan [ Mi, 16 Dezember 2009 11:24 ] [ ID #2026104 ]

Re: rewriterules

On Wed, Dec 16, 2009 at 11:24 AM, Rabadan Palenque, Jose
<jose-rabadan [at] rba.es> wrote:
> Hi,
>
> Whit the help of other member of the list (Antonio) I understood rewriterules is not what I need, the best option is mod_proxy

mod:proxy is one way, and mod_rewrite another. Basically mod_proxy is
for simple cases, but for more complex cases mod_rewrite is quite
usefull.


> This is what I have:
> Server.apache
> Server.plone
>
> And I want this:
> When accessing https://server.apache redirect to http://server.plone but "hiding" the url and showing https://server.apache

In config of "server.apache":

ProxyPass / http://server.plone/
ProxyPassReverse / http://server.plone/

Should do it...


Krist


--
krist.vanbesien [at] gmail.com
krist [at] 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 <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Krist van Besien [ Mi, 16 Dezember 2009 13:12 ] [ ID #2026110 ]
Webserver » gmane.comp.apache.user » rewriterules

Vorheriges Thema: Enabling SSL on a virtual host
Nächstes Thema: Help with redirects and port-forwarding.