You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Rabadan Palenque, Jose" <jo...@rba.es> on 2009/12/14 12:51:03 UTC

[users@httpd] rewriterules

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}:443/$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 

 


Re: [users@httpd] rewriterules

Posted by Krist van Besien <kr...@gmail.com>.
On Wed, Dec 16, 2009 at 11:24 AM, Rabadan Palenque, Jose
<jo...@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@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 <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] rewriterules

Posted by "Rabadan Palenque, Jose" <jo...@rba.es>.
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án



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

On Mon, Dec 14, 2009 at 12:51 PM, Rabadan Palenque, Jose
<jo...@rba.es> wrote:

>             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@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 <URL:http://httpd.apache.org/userslist.html> 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


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewriterules

Posted by Krist van Besien <kr...@gmail.com>.
On Mon, Dec 14, 2009 at 12:51 PM, Rabadan Palenque, Jose
<jo...@rba.es> wrote:

>             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@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 <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] rewriterules

Posted by Justin Pasher <ju...@newmediagateway.com>.
Rabadan Palenque, Jose wrote:
>
> <IfModule mod_rewrite.c>
>
> RewriteEngine On
>
> RewriteRule ^/(.*) 
> http://localhost:8080/VirtualHostBase/https/%{SERVER_NAME}:443/$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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org