[Zope] zope and mod_rewrite

Fritz Mesedilla fritz.mesedilla@summitmedia.com.ph
Fri, 7 Dec 2001 15:15:47 +0800


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C17EEE.FE62AB40
Content-Type: text/plain;
	charset="iso-8859-1"


Can someone help me with web switching for zope and static pages?

This is what I hope to achieve:

1) Visitor visits http://www.maindomain.com/STATIC_PAGE
2) mod_rewrite redirects visitor to http://www.staticdomain.com/STATIC_PAGE

1) Visitor visits http://www.maindomain.com/ZOPE_PAGE
2) mod_rewrite proxxy passes visitor to http://www.maindomain.com/ZOPE_PAGE

I was able to do this using manual rewriterules. But as the static pages
increase, the rules also increase so I plan to use rewritemaps.

Here is a sample of what I have done so far. I need help with this because
proxy does not work and I need proxy for VirtualHostMonster.

Please help me. Thanks.


RewriteEngine on
RewriteLog /home/folder/rewrite.log
RewriteLogLevel 2
RewriteMap   lowercase  int:tolower

# define the map file
RewriteMap   folders      txt:/home/folder/rule.maps

# this does the file-based remap
RewriteRule  ^/([^/]+)/?(.*)
${folders:$1|http://www.zopedomain.com:8080/VirtualHostBase/http/www.maindom
ain.com.ph:80/zopefolder/VirtualHostRoot/$1} [P,L]


fritz <www.mesedilla.com>
systems administrator

summit interactive, inc.
www.fhm.com.ph | www.femalenetwork.com | www.candymag.com
---
+basta ikaw lord

------_=_NextPart_001_01C17EEE.FE62AB40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>zope and mod_rewrite</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=3D2>Can someone help me with web switching for zope and =
static pages?</FONT>
</P>

<P><FONT SIZE=3D2>This is what I hope to achieve:</FONT>
</P>

<P><FONT SIZE=3D2>1) Visitor visits <A =
HREF=3D"http://www.maindomain.com/STATIC_PAGE" =
TARGET=3D"_blank">http://www.maindomain.com/STATIC_PAGE</A></FONT>
<BR><FONT SIZE=3D2>2) mod_rewrite redirects visitor to <A =
HREF=3D"http://www.staticdomain.com/STATIC_PAGE" =
TARGET=3D"_blank">http://www.staticdomain.com/STATIC_PAGE</A></FONT>
</P>

<P><FONT SIZE=3D2>1) Visitor visits <A =
HREF=3D"http://www.maindomain.com/ZOPE_PAGE" =
TARGET=3D"_blank">http://www.maindomain.com/ZOPE_PAGE</A></FONT>
<BR><FONT SIZE=3D2>2) mod_rewrite proxxy passes visitor to <A =
HREF=3D"http://www.maindomain.com/ZOPE_PAGE" =
TARGET=3D"_blank">http://www.maindomain.com/ZOPE_PAGE</A></FONT>
</P>

<P><FONT SIZE=3D2>I was able to do this using manual rewriterules. But =
as the static pages increase, the rules also increase so I plan to use =
rewritemaps.</FONT></P>

<P><FONT SIZE=3D2>Here is a sample of what I have done so far. I need =
help with this because proxy does not work and I need proxy for =
VirtualHostMonster.</FONT></P>

<P><FONT SIZE=3D2>Please help me. Thanks.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>RewriteEngine on</FONT>
<BR><FONT SIZE=3D2>RewriteLog /home/folder/rewrite.log</FONT>
<BR><FONT SIZE=3D2>RewriteLogLevel 2</FONT>
<BR><FONT SIZE=3D2>RewriteMap&nbsp;&nbsp; lowercase&nbsp; =
int:tolower</FONT>
</P>

<P><FONT SIZE=3D2># define the map file</FONT>
<BR><FONT SIZE=3D2>RewriteMap&nbsp;&nbsp; =
folders&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txt:/home/folder/rule.maps</FONT>
</P>

<P><FONT SIZE=3D2># this does the file-based remap</FONT>
<BR><FONT SIZE=3D2>RewriteRule&nbsp; ^/([^/]+)/?(.*)&nbsp;&nbsp; =
${folders:$1|<A =
HREF=3D"http://www.zopedomain.com:8080/VirtualHostBase/http/www.maindoma=
in.com.ph:80/zopefolder/VirtualHostRoot/$1" =
TARGET=3D"_blank">http://www.zopedomain.com:8080/VirtualHostBase/http/ww=
w.maindomain.com.ph:80/zopefolder/VirtualHostRoot/$1</A>} =
[P,L]</FONT></P>
<BR>

<P><FONT SIZE=3D2>fritz &lt;www.mesedilla.com&gt;</FONT>
<BR><FONT SIZE=3D2>systems administrator</FONT>
</P>

<P><FONT SIZE=3D2>summit interactive, inc.</FONT>
<BR><FONT SIZE=3D2>www.fhm.com.ph | www.femalenetwork.com | =
www.candymag.com</FONT>
<BR><FONT SIZE=3D2>---</FONT>
<BR><FONT SIZE=3D2>+basta ikaw lord</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C17EEE.FE62AB40--